Struct iron_shapes::matrix2d::Matrix2d
source · [−]pub struct Matrix2d<T: CoordinateType> { /* private fields */ }
Expand description
A 2x2 matrix of the form:
[[ m11, m12 ],
[ m21, m22 ]]
Implementations
sourceimpl<T> Matrix2d<T> where
T: CoordinateType,
impl<T> Matrix2d<T> where
T: CoordinateType,
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 ]]
sourcepub fn mul_scalar(&self, rhs: T) -> Self
pub fn mul_scalar(&self, rhs: T) -> Self
Compute product of the matrix with a scalar.
sourcepub fn mul_column_vector(&self, rhs: Vector<T>) -> Vector<T>
pub fn mul_column_vector(&self, rhs: Vector<T>) -> Vector<T>
Compute matrix-column-vector multiplication. The vector is interpreted as column vector.
sourcepub fn mul_matrix(&self, rhs: &Self) -> Self
pub fn mul_matrix(&self, rhs: &Self) -> Self
Matrix-matrix multiplication.
sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
Compute the determinant of this matrix.
sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Test if this matrix is the identity matrix.
sourcepub fn is_unitary(&self) -> bool
pub fn is_unitary(&self) -> bool
Test if this matrix is unitary.
sourcepub fn try_inverse(&self) -> Option<Self>
pub fn try_inverse(&self) -> Option<Self>
Compute the inverse matrix.
None
will be returned if the determinant is zero and the matrix
is not invertible.
Trait Implementations
sourceimpl<T: Clone + CoordinateType> Clone for Matrix2d<T>
impl<T: Clone + CoordinateType> Clone for Matrix2d<T>
sourceimpl<T: Debug + CoordinateType> Debug for Matrix2d<T>
impl<T: Debug + CoordinateType> Debug for Matrix2d<T>
sourceimpl<T: CoordinateType> Default for Matrix2d<T>
impl<T: CoordinateType> Default for Matrix2d<T>
sourceimpl<T: Hash + CoordinateType> Hash for Matrix2d<T>
impl<T: Hash + CoordinateType> Hash for Matrix2d<T>
impl<T: Eq + CoordinateType> Eq for Matrix2d<T>
impl<T: CoordinateType> StructuralEq for Matrix2d<T>
impl<T: CoordinateType> StructuralPartialEq for Matrix2d<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Matrix2d<T> where
T: RefUnwindSafe,
impl<T> Send for Matrix2d<T> where
T: Send,
impl<T> Sync for Matrix2d<T> where
T: Sync,
impl<T> Unpin for Matrix2d<T> where
T: Unpin,
impl<T> UnwindSafe for Matrix2d<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more