pub fn solve_cubic(
coeffs: &impl ToInputArray,
roots: &mut impl ToOutputArray,
) -> Result<i32>Expand description
Finds the real roots of a cubic equation.
The function solveCubic finds the real roots of a cubic equation:
- if coeffs is a 4-element vector:
- if coeffs is a 3-element vector:
The roots are stored in the roots array.
§Parameters
- coeffs: equation coefficients, an array of 3 or 4 elements.
- roots: output array of real roots that has 1 or 3 elements.
§Returns
number of real roots. It can be 0, 1 or 2.