Skip to main content

roots

Function roots 

Source
pub fn roots(coefficients: &[f64], tolerance: f64) -> OgeomResult<Vec<f64>>
Expand description

The real roots of a polynomial, in increasing order.

coefficients are in ascending power order: c[0] + c[1] x + c[2] x^2 .... Degrees up to four are solved in closed form; above that the polynomial is deflated by companion-matrix eigenvalues.

Repeated roots are returned once each, since a geometry caller wants the distinct parameter values.

ยงErrors

OgeomError::Construction if every coefficient is zero, where every value is a root.