Trait vector_basis::Basis [−][src]
pub trait Basis<const I: usize>: VectorSpace {
fn basis(&self) -> Self::Scalar;
fn basis_mut(&mut self) -> &mut Self::Scalar;
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
fn unit_basis() -> Self
fn unit_basis() -> Self
Creates an unit basis of the vector space.
Creates a scaled basis of the vector space of the specified magnitude.
fn 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.