Tiny 2D vector library. Inspired by p5.js's
p5.Vector
.
Add veccentric
to your Cargo.toml
.
[dependencies]
veccentric = "0.3"
Basic arithmetic on Vecc<T>
.
use veccentric::Vecc;
let a = Vecc::new(3_i32, 4);
let b = a * 5;
let c = Vecc::new(-10, -8);
let d = b - c;
let e = -d;
Fecc
's extended API.
use veccentric::Fecc;
let a: Fecc = (3.0, 4.0).into();
let b = a / 0.2;
let c = b.limit(20.0);
let d = c.rotate(PI);
let e = d.turn(0.0);