| Crates.io | rs-math3d |
| lib.rs | rs-math3d |
| version | 0.10.0 |
| created_at | 2020-07-14 12:50:52.174038+00 |
| updated_at | 2025-12-26 03:51:28.838287+00 |
| description | Rust 3D Math (no dependency on std) |
| homepage | |
| repository | https://github.com/NeoCogi/rs-math3d |
| max_upload_size | |
| id | 265040 |
| size | 196,459 |
rs-math3d is a no_std-friendly 2D/3D math library focused on computer graphics and geometry. It provides vectors, matrices, quaternions, transforms, and common geometric primitives with utility traits for intersection and distance queries.
Add to Cargo.toml:
[dependencies]
rs-math3d = { version = "0.10", default-features = false }
To enable std-backed math functions:
rs-math3d = { version = "0.10", features = ["std"] }
use rs_math3d::vector::Vector3;
use rs_math3d::transforms;
use rs_math3d::EPS_F32;
fn main() {
let axis = Vector3::new(0.0f32, 1.0, 0.0);
let rot = transforms::rotation_from_axis_angle(&axis, 1.0, EPS_F32)
.expect("axis length too small");
let trans = transforms::translate(Vector3::new(1.0f32, 2.0, 3.0));
let m = trans * rot;
let p = Vector3::new(1.0f32, 0.0, 0.0);
let out = m * p;
println!("{out:?}");
}