pub trait FloatVector<T>: Vector<T>where
T: FloatScalar,{
// Required methods
fn length(&self) -> T;
fn normalize(&self) -> Self;
fn distance(l: &Self, r: &Self) -> T;
}
Expand description
Trait for vectors with floating-point components.
Extends the base Vector
trait with operations that require
floating-point arithmetic, such as length calculation and normalization.
Required Methods§
Sourcefn length(&self) -> T
fn length(&self) -> T
Computes the Euclidean length (magnitude) of the vector.
For vector v:
||v|| = √(v₁² + v₂² + ... + vₙ²)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.