splines 3.4.1

Spline interpolation made easy
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extern crate splines;

use splines::{Interpolation, Key, Spline};

fn main() {
  let keys = vec![
    Key::new(0., 0., Interpolation::default()),
    Key::new(5., 1., Interpolation::default()),
  ];
  let spline = Spline::from_vec(keys);

  println!("value at 0: {:?}", spline.clamped_sample(0.));
  println!("value at 3: {:?}", spline.clamped_sample(3.));
}