Expand description
Backend-agnostic spatial vectors, motion subspaces, transforms, and inertias.
The default builtin feature uses fixed Rust arrays. Disable default features
to provide your own SpatialRepresentation, or enable nalgebra and/or
glam to use Nalgebra and Glam as the second public type parameter,
for example MotionVector<f64, Nalgebra>.
The library source is always no_std. The default std feature forwards
std support to enabled numeric dependencies. Disable defaults for bare-metal
use; floating-point fallback support is enabled automatically. With supplied
backends and f32/f64, verified operations require no global allocator.
Custom implementations and serialization adapters control their own resource
requirements. This crate provides no panic handler or panic-free guarantee.
Fixed-storage motion/force pairing with the builtin feature:
use spatial6::{Builtin, ForceVector, MotionVector};
let motion = MotionVector::<f64, Builtin>::new([0.0, 0.0, 1.0], [2.0, 0.0, 0.0]);
let force = ForceVector::<f64, Builtin>::new([0.0, 0.0, 3.0], [4.0, 0.0, 0.0]);
assert_eq!(motion.dot(&force), 11.0);Structs§
- Articulated
Body Inertia - A finite symmetric six-by-six spatial operator stored as its twenty-one upper-triangular components in row-major order.
- Builtin
- Uses fixed-size Rust arrays for all vector, matrix, and rotation
storage:
[T; 3]forVector3,[T; 6]forVector6,[[T; 3]; 3]forMatrix3andRotation3, and[[T; 6]; 6]forMatrix6. - Force
Vector - A Plücker force vector, with moment coordinates before force coordinates.
- Glam
- Uses glam
Vec3/DVec3forVector3andMat3/DMat3for bothMatrix3andRotation3(glam has no dedicated rotation type);Vector6andMatrix6remain Rust arrays because glam has no 6D types. - Motion
Subspace - A fixed-size motion subspace whose columns are spatial motion vectors.
- Motion
Vector - A Plücker motion vector, with angular coordinates before linear coordinates.
- Nalgebra
- Uses nalgebra’s statically sized types as backend storage:
Vector3<T>forVector3,SVector<T, 6>forVector6,Matrix3<T>forMatrix3,SMatrix<T, 6, 6>forMatrix6, andRotation3<T>forRotation3. - Rigid
Body Inertia - A rigid-body spatial inertia stored as ten scalar parameters: mass, center
of mass, and the six independent components of the rotational inertia
about the center of mass. Also available under its usual name,
SpatialInertia. - Spatial
Transform - A compact spatial coordinate transform from a source frame to a destination frame.
Enums§
- Inertia
Error - Errors returned when constructing or operating on an inertia.
Traits§
- Spatial
Representation - Maps semantic spatial arrays to backend-specific storage.
- Spatial
Scalar - A scalar type supported by spatial vector and matrix operations.
Type Aliases§
- Spatial
Coordinates - The six coordinates used by spatial motion and force vectors.
- Spatial
Inertia - The usual name for
RigidBodyInertia. - Spatial
Matrix - A 6x6 spatial matrix.