MCPcopy Create free account
hub / github.com/elftausend/graplot / Polynomial

Class Polynomial

src/polynomial.rs:13–15  ·  view source on GitHub ↗

Use the Polynomial struct or polynomial() function to create a polynomial function that runs through all given points. # Example ``` use graplot::{x, Plot, Polynomial}; let poly = Polynomial::new(&[2., 3., 1.], &[2., 3., 2.]); let plot = Plot::new((poly, x(10.))); plot.show(); ```

Source from the content-addressed store, hash-verified

11/// plot.show();
12/// ```
13pub struct Polynomial {
14 coefficients: Vec<f64>,
15}
16
17impl Polynomial {
18 pub fn new(xs: &[f64], ys: &[f64]) -> Polynomial {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected