Function geometric_algebra::polynomial::solve_cubic
source · pub fn solve_cubic(
coefficients: [f32; 4],
error_margin: f32
) -> (f32, Vec<Root>, usize)
Expand description
Finds the discriminant and roots of a degree 3 polynomial.
0 = coefficients[3] * x.powi(3) + coefficients[2] * x.powi(2) + coefficients[1] * x + coefficients[0]
Also returns the index of the real root if there are two complex roots and one real root.