Function mrpt::math::solve_poly3
Defined in File poly_roots.h
Function Documentation
-
int mrpt::math::solve_poly3(double *x, double a, double b, double c) noexcept
Solves cubic equation
x^3 + a*x^2 + b*x + c = 0. Returns the number of real rootsN<=3. The roots are returned in the first entries ofx, i.e.x[0]if N=1,x[0]andx[1]if N=2, etc.Note
Based on
poly34.h, by Khashin S.I. http://math.ivanovo.ac.ru/dalgebra/Khashin/index.html - khash2 (at) gmail.com- Parameters:
x – array of size 3