cubic_spline

Crates.io

Interpolation methods for computation of cubic spline points within the range of a discrete set of known points.

Online documentation

Example for flatten vec

```rust use cubic_spline::{Spline, SplineOpts};

let opts: SplineOpts = Default::default();

let points = vec![10.0, 200.0, 256.0, 390.0, 512.0, 10.0, 778.0, 200.0];

let splinepoints = Spline::fromflatten_points(&points, &opts);

asserteq!(splinepoints.len(), 102); ```

Example for tuples vec

```rust use cubic_spline::{Spline, SplineOpts};

let opts: SplineOpts = Default::default();

let points = vec![(10.0, 200.0), (256.0, 390.0), (512.0, 10.0), (778.0, 200.0)];

let splinepoints = Spline::fromtuples(&points, &opts);

let (lastx, lasty) = splinepoints.last().unwrap(); asserteq!(last_y, 200.0); ```

Enjoy using!

License

This module is MIT licensed.