simple-vectors
Simple, dimension-generic vector mathematics for Rust.
Types
Vector<T, N>- generic fixed-size vector wrapping[T; N]Point<T, N>- generic affine point wrapping[T; N]
Features
- Dimension and type generic: Works with any compile-time dimension and scalar type
- Affine geometry:
Point - Point -> Vector,Point + Vector -> Point - Trait integration: Implements
VectorSpace,DotProduct,InnerSpace,Basis<I>from the vector-space ecosystem - Optional parsing: Parsing support via the
parsablefeature
Example
use ;
let a = new;
let b = new;
let displacement: = b - a;
let v = new;
let w = new;
let dot = v * w;
let scaled = v * 2.0;
AI-assisted development
This crate is designed for use with AI coding assistants. Consistent trait implementations, no implicit behavior, and standard VectorSpace/InnerSpace trait integration make it straightforward for AI to work with. The dimension-generic design means a single type works for 2D, 3D, or any other dimensionality.