fmath-0.2.3 has been yanked.
fmath
Math Library for my personal Rust Projects
About
This is not a general-purpose math library. It is specifically written for my purposes only.
Feel free to use it in your projects if it fits your needs, don't even worry about attribution :)
How to use
Include
in Cargo.toml file...
fmath = "*current-version*"
Documentation
build documentation with cargo doc in the command line
cargo doc
Example
use ;
// Vector
let v1 = new; // Vector2: 1.2, 3.4
let v2 = new; // Vector2: 4.5, 6.7
let v3 = v1 + v2; // Vector2: 5.7, 10.1
let dot_prod = dot; // v1 ⋅ v2
// Matrix4x4
let m1 = new_identity;
let m2 = new_translate;
let m3 = m1 * m2; // Matrix multiplication
let mut v4 = new;
// multiply vector by matrix, m3 is a translation matrix
// result = Vector3: 1.2, 2.0, 3.0
v4 = mul_vector3;
// Color
let rgb = RGBnew_yellow;
let hsv = HSVfrom_rgb;
println!; // 60, 1.0, 1.0
println!; // 255, 255, 0.0, 255
let rgb_2 = RGBfrom_hex.unwrap;
println!; // 153, 77, 212