Expand description
Traits for vector inner products and common operations.
Provides DotProduct trait.
If the default dot product with scalar output is implemented for a type, the InnerSpace trait will be derived for it, which provides many useful helpers like magnitude, normalize, project, reject, reflect, angle, …
Use this to build libraries generic over these trait, like rendering, physics, and vector math.
Traits§
- Affine
Space - Marker trait for affine spaces, types whose differences are vectors.
- DotProduct
- This trait defines the dot product.
- Inner
Space - This trait adds common vector operations to a vector space if the dot product is defined.
- Vector
Space - This trait specifies some type to be a vector type. It specifies the scalar type and is required for other vector types.
- Vector
Space Assign - This trait is automatically implemented for vector spaces, which also implement assignment operations.
Functions§
- distance
- The distance between two points.
- distance2
- The squared distance between two points.
- interpolate
- Linear interpolation of two points.