makima_spline

An implementation of the modified akima spline interpolation


Keywords
spline, interpolation, akima, interpolation-methods, mathematics, rust, rust-lang, rust-library
License
MIT

Documentation

makima_spline

A implementation of the modified akima interpolation
+ additionally features linear extrapolation

HowTo

use makima_spline::Spline;

your data is in some format

let x = vec![1., 2., 3., 4., 5., 6., 7., 8.];
let y = vec![-1., -1., -1., 0.0, 1., 1., 1., 1.];

convert to the type used by the spline Vec<(f64, f64)>

let points = makima_spline::vec_to_points(&x, &y);

build the spline from the data-points

let spline = Spline::from_vec(points);

To sample do this:

let y = spline.sample(x);