symtropy-math 0.1.0

N-dimensional geometric algebra: const-generic points, bivectors, rotors, and collision shapes (2D/3D/4D+). Stack-allocated, zero-heap physics primitives.
Documentation
  • Coverage
  • 59.84%
    73 out of 122 items documented1 out of 83 items with examples
  • Size
  • Source code size: 92.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.76 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 39s Average build duration of successful builds.
  • all releases: 1m 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Tristan-Stoltz-ERC

symtropy-math

N-dimensional geometric algebra for game physics. Stack-allocated, zero-heap, const-generic.

use symtropy_math::{Point, Bivector, Rotor};

// 3D rotation in the xy plane by 90°
let plane = Bivector::<3>::unit_plane(0, 1);
let r = Rotor::from_plane_angle(&plane, std::f64::consts::FRAC_PI_2);
let p = Point::<3>::new([1.0, 0.0, 0.0]);
let rotated = r.rotate_point(&p); // → (0, 1, 0)

// Works in 4D too
let tesseract_rotation = Bivector::<4>::unit_plane(0, 3);
let r4d = Rotor::from_plane_angle(&tesseract_rotation, 0.5);

Features

  • Point<D>, Bivector<D>, Rotor<D>, Transform<D> — all const-generic
  • Shape<D> trait with GJK-compatible support function
  • Sphere<D>, ConvexHull<D>, Hyperplane<D> colliders
  • Stack-allocated via nalgebra::SVector — zero heap in hot paths
  • Works in 2D, 3D, 4D, or any dimension
  • WASM compatible

Why Bivectors Instead of Quaternions?

Quaternions only work in 3D. Bivectors (oriented planes) generalize rotations to any dimension. A rotation happens in a plane, not around an axis. In 4D there are 6 rotation planes — bivectors handle this naturally.

Part of the Symtropy consciousness-physics engine.