Skip to content

Tiny 2D vector library. Inspired by p5.js's p5.Vector.

Notifications You must be signed in to change notification settings

micouy/veccentric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

veccentric

docs.rs crates.io

Tiny 2D vector library. Inspired by p5.js's p5.Vector.

Usage

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);

See more examples.

About

Tiny 2D vector library. Inspired by p5.js's p5.Vector.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages