2 releases

0.0.2 Mar 29, 2021
0.0.1 Dec 27, 2017

#258 in Algorithms

Download history 486/week @ 2021-04-01 513/week @ 2021-04-08 377/week @ 2021-04-15 408/week @ 2021-04-22 119/week @ 2021-04-29 473/week @ 2021-05-06 732/week @ 2021-05-13 625/week @ 2021-05-20 743/week @ 2021-05-27 742/week @ 2021-06-03 688/week @ 2021-06-10 407/week @ 2021-06-17 360/week @ 2021-06-24 348/week @ 2021-07-01 565/week @ 2021-07-08 378/week @ 2021-07-15

1,601 downloads per month
Used in 10 crates (2 directly)

Apache-2.0

110KB
348 lines

trajectory

Build Status crates.io docs

Trajectory interpolator for Rust.

Code example

let times = vec![0.0, 1.0, 3.0, 4.0];
let points = vec![
    vec![0.0, -1.0],
    vec![2.0, -3.0],
    vec![3.0, 3.0],
    vec![1.0, 5.0],
];
let ip = CubicSpline::new(times, points).unwrap();
for i in 0..400 {
    let t = i as f64 * 0.01f64;
    let p = ip.position(t).unwrap();
    let v = ip.velocity(t).unwrap();
    let a = ip.acceleration(t).unwrap();
}

Run example

It requires gnuplot.

cargo run --example plot

Dependencies