pub struct Matrix2<T: CoordType> { /* private fields */ }Expand description
A 2x2 matrix of the form: [[ m11, m12 ], [ m21, m22 ]]
Implementations§
Source§impl<T> Matrix2<T>where
T: CoordType,
impl<T> Matrix2<T>where
T: CoordType,
Sourcepub fn new(m11: T, m12: T, m21: T, m22: T) -> Self
pub fn new(m11: T, m12: T, m21: T, m22: T) -> Self
Create a new 2x2 matrix with entries of the form:
[[ m11, m12 ],
[ m21, m22 ]]pub fn identity() -> Self
pub fn scaler_mul(&self, rhs: T) -> Self
pub fn mul_vec(&self, rhs: Vec2<T>) -> Vec2<T>
pub fn mat_mul(&self, rhs: &Self) -> Self
pub fn transpose(&self) -> Self
pub fn determinant(&self) -> T
pub fn is_identity(&self) -> bool
pub fn is_unitary(&self) -> bool
pub fn try_inverse(&self) -> Option<Self>
Trait Implementations§
impl<T: Eq + CoordType> Eq for Matrix2<T>
impl<T: PartialEq + CoordType> StructuralPartialEq for Matrix2<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix2<T>where
T: Freeze,
impl<T> RefUnwindSafe for Matrix2<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix2<T>where
T: Send,
impl<T> Sync for Matrix2<T>where
T: Sync,
impl<T> Unpin for Matrix2<T>where
T: Unpin,
impl<T> UnsafeUnpin for Matrix2<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Matrix2<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more