3 unstable releases

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

#1381 in Algorithms

Download history 81/week @ 2024-03-11 64/week @ 2024-03-18 130/week @ 2024-03-25 143/week @ 2024-04-01 166/week @ 2024-04-08 79/week @ 2024-04-15 48/week @ 2024-04-22 56/week @ 2024-04-29 61/week @ 2024-05-06 78/week @ 2024-05-13 55/week @ 2024-05-20 74/week @ 2024-05-27 35/week @ 2024-06-03 52/week @ 2024-06-10 48/week @ 2024-06-17 34/week @ 2024-06-24

173 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