functionccubicRoots

Analytical solution for the roots of a cubic equation (a*x^3+b*x^2+c*x+d=0)

Information


Return roots[3] where each root is complex (i.e., has both roots[*].re and roots[*].im ).


nRoots helps to identify the number of expected real roots based on the result from the polynomial discriminant, D.

Inputs

TypeNameDefaultDescription
Reala
Realb
Realc
Reald

Outputs

TypeNameDefaultDescription
ComplexrootsReal roots
RealnRootsNumber of distinct real solutions expected