Struct oxygen_quark::matrix::matrix3x3::Matrix3x3
source · Fields§
§data: [Fraction; 9]
The matrix data.
Implementations§
source§impl Matrix3x3
impl Matrix3x3
sourcepub fn new_from_value(value: Fraction) -> Matrix3x3
pub fn new_from_value(value: Fraction) -> Matrix3x3
Generates a new Matrix3x3
from the Fraction
specified.
sourcepub fn new_from_values(values: &[Fraction]) -> Matrix3x3
pub fn new_from_values(values: &[Fraction]) -> Matrix3x3
Generates a new Matrix3x3
from a list of Fraction
values.
sourcepub fn scale(&self, scale: Fraction) -> Matrix3x3
pub fn scale(&self, scale: Fraction) -> Matrix3x3
Scales the given Matrix4x4
by the given Fraction
.
sourcepub fn adjugate(&self) -> Matrix3x3
pub fn adjugate(&self) -> Matrix3x3
Returns the adjugate of the Matrix3x3
.
Equal to calling cofactor() and then transpose().
sourcepub fn determinant(&self) -> Fraction
pub fn determinant(&self) -> Fraction
Calculates the determinant of the Matrix3x3
and returns it, a Fraction
.
sourcepub fn inverse(&self) -> Option<Matrix3x3>
pub fn inverse(&self) -> Option<Matrix3x3>
Returns an Option<Matrix3x3>
.
It returns an Option<Matrix3x3>
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.
sourcepub fn transform_vector2d(&self, other: &Vector2D) -> Vector2D
pub fn transform_vector2d(&self, other: &Vector2D) -> Vector2D
Transforms a Vector2D
with the Matrix3x3
and returns the result, a Vector2D
.
sourcepub fn transform_vector3d(&self, other: &Vector3D) -> Vector3D
pub fn transform_vector3d(&self, other: &Vector3D) -> Vector3D
Transforms a Vector3D
with the Matrix3x3
and returns the result, a Vector3D
.
Trait Implementations§
source§impl AddAssign<Matrix3x3> for Matrix3x3
impl AddAssign<Matrix3x3> for Matrix3x3
source§fn add_assign(&mut self, other: Matrix3x3)
fn add_assign(&mut self, other: Matrix3x3)
Performs the
+=
operation. Read moresource§impl MulAssign<Matrix3x3> for Matrix3x3
impl MulAssign<Matrix3x3> for Matrix3x3
source§fn mul_assign(&mut self, other: Matrix3x3)
fn mul_assign(&mut self, other: Matrix3x3)
Performs the
*=
operation. Read moresource§impl SubAssign<Matrix3x3> for Matrix3x3
impl SubAssign<Matrix3x3> for Matrix3x3
source§fn sub_assign(&mut self, other: Matrix3x3)
fn sub_assign(&mut self, other: Matrix3x3)
Performs the
-=
operation. Read more