splines/examples/01-hello-world/src/main.rs

12 lines
342 B
Rust
Raw Normal View History

2018-08-07 01:28:12 +02:00
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.));
}