[−]Function druid::piet::kurbo::common::solve_cubic
pub fn solve_cubic(c0: f64, c1: f64, c2: f64, c3: f64) -> ArrayVec<[f64; 3]>
Find real roots of cubic equation.
The implementation is not (yet) fully robust, but it does handle the case
where c3
is zero (in that case, solving the quadratic equation).
See: http://mathworld.wolfram.com/CubicFormula.html
Returns values of x for which c0 + c1 x + c2 x² + c3 x³ = 0.