3 unstable releases

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

#1037 in Algorithms

Download history 81/week @ 2023-12-05 80/week @ 2023-12-12 88/week @ 2023-12-19 67/week @ 2023-12-26 67/week @ 2024-01-02 145/week @ 2024-01-09 93/week @ 2024-01-16 60/week @ 2024-01-23 28/week @ 2024-01-30 69/week @ 2024-02-06 65/week @ 2024-02-13 72/week @ 2024-02-20 96/week @ 2024-02-27 102/week @ 2024-03-05 67/week @ 2024-03-12 85/week @ 2024-03-19

364 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