Skip to content

Ztry8/VecMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VecMate

GitHub last commit crates.io docs.rs License

Lightweight, zero-dependency, type-agnostic library for vector math.

let mut position = consts::f32::ZERO;
let target = vec2(10.0, 5.0);
let speed = 2.0;

let direction = (target - position).normalize();
position += direction * speed;

println!("Moving towards {target}");
println!("New position: {position}");

Why?

I didn't find any simple libraries for vector mathematics, so I decided to write my own!
VecMate is focused on minimalism and clarity

Installation

Run in a project root:

cargo add vecmate

Or add it manually to your Cargo.toml:

[dependencies]
vecmate = "*"

Contributing

Any pull-requests and issues are welcome!
Please remember that one of the goals of the library is to be dependency-free,
Therefore, any proposals that contain dependencies will be rejected.
Please adhere to the architecture and style of the project.

TODO

  • More constants
  • More functions
  • 3D vectors
  • 4D vectors

About

Lightweight, zero-dependency, type-agnostic library for vector math.

Topics

Resources

License

Stars

Watchers

Forks

Languages