Crates.io | veccentric |
lib.rs | veccentric |
version | 0.3.1 |
source | src |
created_at | 2021-08-08 18:36:26.912461 |
updated_at | 2021-09-22 18:59:16.505174 |
description | Tiny 2D vector library. |
homepage | |
repository | https://github.com/micouy/veccentric |
max_upload_size | |
id | 433286 |
size | 406,491 |
veccentric
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);