Struct oxygen_quark::matrix::matrix2x2::Matrix2x2
source · Fields
data: [Fraction; 4]
The matrix data.
Trait Implementations
sourceimpl AddAssign<Matrix2x2> for Matrix2x2
impl AddAssign<Matrix2x2> for Matrix2x2
sourcefn add_assign(&mut self, other: Matrix2x2)
fn add_assign(&mut self, other: Matrix2x2)
Performs the
+=
operation. Read moresourceimpl Matrix for Matrix2x2
impl Matrix for Matrix2x2
sourcefn from_slice(values: &[Self::Data]) -> Self
fn from_slice(values: &[Self::Data]) -> Self
Generates a new Matrix2x2
from a list of Fraction
values.
sourcefn determinant(&self) -> Result<Self::Data, MatrixError>
fn determinant(&self) -> Result<Self::Data, MatrixError>
Calculates the determinant of the Matrix2x2
and returns it, a Fraction
.
sourcefn cofactor(&self) -> Result<Self, MatrixError>
fn cofactor(&self) -> Result<Self, MatrixError>
Returns the cofactor of the Matrix2x2
.
sourcefn adjugate(&self) -> Result<Self, MatrixError>
fn adjugate(&self) -> Result<Self, MatrixError>
Returns the adjugate of the Matrix2x2
.
Equal to calling cofactor() and then transpose().
sourcefn inverse(&self) -> Result<Self, MatrixError>where
Self: Sized,
fn inverse(&self) -> Result<Self, MatrixError>where
Self: Sized,
Returns a Result<Matrix2x2, ZeroDeterminantError>
.
It returns an Result<Matrix2x2, ZeroDeterminantError>
because there won’t always be an inverse (if the determinant is 0
), hence requires some extra checking.
Panics
Panics when trying to unwrap()
a None
-value.
sourceimpl MulAssign<Matrix2x2> for Matrix2x2
impl MulAssign<Matrix2x2> for Matrix2x2
sourcefn mul_assign(&mut self, other: Matrix2x2)
fn mul_assign(&mut self, other: Matrix2x2)
Performs the
*=
operation. Read moresourceimpl SubAssign<Matrix2x2> for Matrix2x2
impl SubAssign<Matrix2x2> for Matrix2x2
sourcefn sub_assign(&mut self, other: Matrix2x2)
fn sub_assign(&mut self, other: Matrix2x2)
Performs the
-=
operation. Read moresourceimpl TransformVector<Vector2D> for Matrix2x2
impl TransformVector<Vector2D> for Matrix2x2
fn transform_vector(&self, other: Vector2D) -> Result<Vector2D, VectorError>
impl Copy for Matrix2x2
impl Eq for Matrix2x2
Auto Trait Implementations
impl RefUnwindSafe for Matrix2x2
impl Send for Matrix2x2
impl Sync for Matrix2x2
impl Unpin for Matrix2x2
impl UnwindSafe for Matrix2x2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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