| Crates.io | sp2 |
| lib.rs | sp2 |
| version | 0.3.0 |
| created_at | 2022-10-09 21:12:29.09196+00 |
| updated_at | 2026-01-17 12:08:45.504116+00 |
| description | 2D spatial transforms and movement representations using geometric algebra |
| homepage | https://gitlab.com/porky11/sp2 |
| repository | https://gitlab.com/porky11/sp2 |
| max_upload_size | |
| id | 684195 |
| size | 14,771 |
Minimal 2D spatial transforms using geometric algebra.
Transform: Translation and orientation with full operator supportMovement: Velocity and rotation representationuse ga2::{Bivector, Vector};
use sp2::{Movement, Transform};
let mut transform = Transform {
translation: Vector::new(1.0, 2.0),
orientation: Vector::x(1.0) * Vector::y(1.0),
};
let movement = Movement {
velocity: Vector::new(-1.0, 0.0),
rotation: Bivector::new(1.0),
};
transform += movement;
assert_eq!(transform.translation, Vector::new(0.0, 2.0));