3 unstable releases

0.1.0 Oct 25, 2022
0.0.2 Mar 29, 2021
0.0.1 Dec 27, 2017

#1444 in Algorithms

Download history 40/week @ 2024-07-21 103/week @ 2024-07-28 78/week @ 2024-08-04 27/week @ 2024-08-11 19/week @ 2024-08-18 58/week @ 2024-08-25 87/week @ 2024-09-01 89/week @ 2024-09-08 29/week @ 2024-09-15 60/week @ 2024-09-22 82/week @ 2024-09-29 10/week @ 2024-10-06 26/week @ 2024-10-13 57/week @ 2024-10-20 24/week @ 2024-10-27 80/week @ 2024-11-03

187 downloads per month
Used in 9 crates (2 directly)

Apache-2.0

110KB
354 lines

trajectory

Build Status crates.io docs

Trajectory interpolator for Rust.

Code example

use trajectory::{CubicSpline, Trajectory};

let times = vec![0.0_f64, 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.01_f64;
    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

plot1 plot2

Dependencies