fixed-vectors

GitHub - Publish Status Docs.rs - Latest Crates.io - Downloads Crates.io - Version Crates.io - License

Library implementing fixed-length vectors meant for representing positional and dimensional values. These vectors have various mathematical and helper functions implemented for them out of the box for ease of use in calculations, especially game development related ones. These methods are all implemented using the impl_vector! macro.

Example

```rust use fixed_vectors::Vector2; use std::convert::TryFrom;

let strvec = Vector2::new("Hello", "World"); asserteq!(strvec.totuple(), ("Hello", "World"));

let mut numvec = Vector2::new(1.0, 2.0); numvec += Vector2::new(0.4, 0.9); asserteq!(numvec.round(), Vector2::new(1.0, 3.0));

if let Ok(fromvecvec) = Vector2::tryfrom(vec![4, 2]) { asserteq!(fromvecvec, Vector2::new(4, 2)); } ```