Crates.io | trajectory |
lib.rs | trajectory |
version | 0.1.0 |
source | src |
created_at | 2017-12-27 10:04:13.338762 |
updated_at | 2022-10-25 08:29:42.117971 |
description | Trajectory interpolation |
homepage | |
repository | https://github.com/openrr/trajectory |
max_upload_size | |
id | 44537 |
size | 149,237 |
Trajectory interpolator for Rust.
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();
}
It requires gnuplot
.
cargo run --example plot