mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
initial checkin of C++ port (in progress)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@2 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
#ifndef HEADER_GFX_POLYNOMIAL
|
||||
#define HEADER_GFX_POLYNOMIAL
|
||||
|
||||
/** @file gfx/polynomial.hpp
|
||||
*
|
||||
* Solutions to polynomials, used by bezier curve algorithms
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <util/prec.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Solving
|
||||
|
||||
/// Solve a linear equation a x + b = 0
|
||||
/** Returns the number of real roots, and the roots themselfs in the output parameter.
|
||||
*/
|
||||
UInt solveLinear(double a, double b, double* root);
|
||||
|
||||
/// Solve a quadratic equation a x^2 + b x + c == 0
|
||||
/** Returns the number of real roots, and the roots themselfs in the output parameter.
|
||||
*/
|
||||
UInt solveQuadratic(double a, double b, double c, double* roots);
|
||||
|
||||
// Solve a cubic equation a x^3 + b x^2 + c x + d == 0
|
||||
/** Returns the number of real roots, and the roots themselfs in the output parameter.
|
||||
*/
|
||||
UInt solveCubic(double a, double b, double c, double d, double* roots);
|
||||
|
||||
// Solve a cubic equation x^3 + a x^2 + b x + c == 0
|
||||
/** Returns the number of real roots, and the roots themselfs in the output parameter.
|
||||
* Based on http://en.wikipedia.org/wiki/Cubic_equation
|
||||
*/
|
||||
UInt solveCubic(double a, double b, double c, double* roots);
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
Reference in New Issue
Block a user