sp2

Crates.iosp2
lib.rssp2
version0.3.0
created_at2022-10-09 21:12:29.09196+00
updated_at2026-01-17 12:08:45.504116+00
description2D spatial transforms and movement representations using geometric algebra
homepagehttps://gitlab.com/porky11/sp2
repositoryhttps://gitlab.com/porky11/sp2
max_upload_size
id684195
size14,771
Fabio Krapohl (porky11)

documentation

https://docs.rs/sp2

README

SP2 - 2D Spatial Transforms

Crates.io Docs License

Minimal 2D spatial transforms using geometric algebra.

Features

  • Transform: Translation and orientation with full operator support
  • Movement: Velocity and rotation representation
  • Geometric algebra-based operations

Example

use 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));
Commit count: 16

cargo fmt