SolveEquation3n


Overloaded template function to solve cubic equations. It can be used only with float data types.

You can find more information in comments below.

// Find solutions of x * x * x + a * x * x + b * x + c = 0 equation and store them in x1, x2, and x3. Return number of found solutions including complex ones. Return either 2 or 3template<class TYPE>
int SolveEquation3n(const TYPE a, const TYPE b, const TYPE c, TComplex<TYPE> &x1, TComplex<TYPE> &x2, TComplex<TYPE> &x3);
// Find solutions of a * x * x * x + b * x * x + c * x + d = 0 equation and store them in x1, x2, and x3. Return number of found solutions including complex ones. Return 0(if a, b, and c are zero), 2 or 3. Tolerance is used to compare a, b, and c with zerotemplate<class TYPE>
int SolveEquation3n(const TYPE a, const TYPE b, const TYPE c, const TYPE d, TComplex<TYPE> &x1, TComplex<TYPE> &x2, TComplex<TYPE> &x3, const TYPE tolerance);
Namespace: ntl
Include: NTL/Core/Complex.h