pub trait Basis<const I: usize>: VectorSpace {
// Required methods
fn basis(&self) -> Self::Scalar;
fn basis_mut(&mut self) -> &mut Self::Scalar;
// Provided methods
fn unit_basis() -> Self { ... }
fn basis_of(magnitude: Self::Scalar) -> Self { ... }
fn with_basis(self, magnitude: Self::Scalar) -> Self { ... }
}
Expand description
This trait makes it possible to deal with the bases of a vector in a generic way.
Required Methods§
Provided Methods§
Sourcefn unit_basis() -> Self
fn unit_basis() -> Self
Creates an unit basis of the vector space.
Sourcefn basis_of(magnitude: Self::Scalar) -> Self
fn basis_of(magnitude: Self::Scalar) -> Self
Creates a scaled basis of the vector space of the specified magnitude.
Sourcefn with_basis(self, magnitude: Self::Scalar) -> Self
fn with_basis(self, magnitude: Self::Scalar) -> Self
Creates a new vector with a single basis set to a different value.
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.