Function geomorph::math::polyval [−][src]
pub fn polyval(order: usize, coefficents: &[f64], x: f64) -> f64
Inverse polynomial calculation with Horner's method
Arguments
order: usize
- Order of the polynomcoefficents: &[f64]
- Slice with the coefficents of the polynom.[1.0, 0.0, -3.5]
means1.0 * x.powi(2) + 0.0 * x - 3.5
. Size must beorder + 1
, minimum.x: f64
- X to be evaluated
Example
let order: usize = 5; let coefficents = vec![1.0, -3.5, 0.0, 14.0, 28.1, -155.0]; let x: f64 = 2.7; let y: f64 = geomorph::math::polyval(order, &coefficents, x);