| Crates.io | vectorama |
| lib.rs | vectorama |
| version | 0.1.1 |
| created_at | 2025-08-06 01:14:57.350823+00 |
| updated_at | 2025-08-07 06:39:02.356051+00 |
| description | Very simple linear algebra library for Rust |
| homepage | |
| repository | https://github.com/osimarr/vectorama |
| max_upload_size | |
| id | 1783281 |
| size | 179,539 |
Very simple linear algebra library for Rust.
This crate is designed for OpenGL and glTF standards: it uses column-major matrices, YXZ Euler rotation order, and is hardcoded to use the f32 data type.
f32-only types for performance and interoperabilitynalgebra] (optional, via feature flags)use vectorama::Vec3;
let v = Vec3::new(1.0, 2.0, 3.0);
let w = Vec3::ones();
let sum = v + w;
println!("{:?}", sum); // Vec3 { x: 2.0, y: 3.0, z: 4.0 }
use vectorama::Mat3;
let a = Mat3::ones();
let b = Mat3::ones();
let c = a * b;
println!("{:?}", c);
use vectorama::{UnitQuaternion, Vec3};
let axis = Vec3::new(0.0, 1.0, 0.0);
let angle = std::f32::consts::FRAC_PI_2;
let q = UnitQuaternion::from_axis_angle(axis, angle);
let v = Vec3::new(1.0, 0.0, 0.0);
let rotated = q.rotate_vector(v);
println!("{:?}", rotated);
use vectorama::{Translation3, Vec3};
let t = Translation3::new(1.0, 2.0, 3.0);
let v = Vec3::new(0.0, 0.0, 0.0);
let translated = t * v;
println!("{:?}", translated); // Vec3 { x: 1.0, y: 2.0, z: 3.0 }
This project is dual-licensed under the MIT License and the Apache License 2.0. You may choose either license to govern your use of this project.
SPDX-License-Identifier: MIT OR Apache-2.0