ga3
3D geometric algebra types for Rust.
Types
Vector<T>- 3D vector withx,y,zcomponentsBivector<T>- 3D bivector withxy,xz,yzcomponentsRotor<T>- 3D rotor withscalar,xy,xz,yzcomponents (rotation operator)Point<T>- 3D affine point withx,y,zcomponents
Features
- Full arithmetic on all types (add, sub, mul, div, neg)
- Geometric product:
Vector * Vector -> Rotor - Wedge product:
Vector::wedge(other) -> Bivector - Cross product:
Vector::cross(other) -> Vector - Rotor rotation via sandwich product
Rotorimplementsvector_space::Transform<Vector<T>>Point - Point -> Vector(AffineSpace)Display/FromStrfor all typesVectorSpace,DotProduct,InnerSpacetrait integrationBasis<0>,Basis<1>,Basis<2>for component access- Optional serialization via
data-streamfeature - Optional parsing via
parsablefeature
Example
use ;
let a = new;
let b = new;
let displacement: = b - a;
let rotor = xy.exp;
let rotated = rotor.rotate;
let normal = x.cross;
AI-assisted development
This crate is designed for use with AI coding assistants. Consistent trait implementations across all types, no implicit behavior, Display/FromStr on all public types, and standard VectorSpace/InnerSpace trait integration make it straightforward for AI to work with.