Struct maria_linalg::Vector
source · pub struct Vector<const N: usize> { /* private fields */ }Expand description
Abstracts over a vector of arbitary dimension.
Implementations§
source§impl<const N: usize> Vector<N>
impl<const N: usize> Vector<N>
Implements necessary behaviors of a vector.
sourcepub fn scale(&self, scalar: f64) -> Self
pub fn scale(&self, scalar: f64) -> Self
Scales a vector by a provided scalar, returning the new vector.
sourcepub fn cross(&self, other: Self) -> Self
pub fn cross(&self, other: Self) -> Self
Crosses this vector with another vector.
Note: this is only implemented for Vector<3>.
Otherwise, this returns a zero vector.
sourcepub fn mult(&self, matrix: Matrix<N>) -> Self
pub fn mult(&self, matrix: Matrix<N>) -> Self
Left-multiplies the provided matrix by the transpose of this vector, returning the result.
Trait Implementations§
source§impl<const N: usize> PartialEq for Vector<N>
impl<const N: usize> PartialEq for Vector<N>
impl<const N: usize> Copy for Vector<N>
impl<const N: usize> StructuralPartialEq for Vector<N>
Auto Trait Implementations§
impl<const N: usize> RefUnwindSafe for Vector<N>
impl<const N: usize> Send for Vector<N>
impl<const N: usize> Sync for Vector<N>
impl<const N: usize> Unpin for Vector<N>
impl<const N: usize> UnwindSafe for Vector<N>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more