#[repr(C)]pub struct Matrix33<T>where
T: Real,{
pub x: [T; 9],
}
Expand description
3x3 Matrix type over Real
Fields§
§x: [T; 9]
Implementations§
Source§impl<T> Matrix33<T>where
T: Real,
impl<T> Matrix33<T>where
T: Real,
Sourcepub fn make_identity() -> Matrix33<T>
pub fn make_identity() -> Matrix33<T>
Return a new identity matrix
Sourcepub fn new(values: [T; 9]) -> Matrix33<T>
pub fn new(values: [T; 9]) -> Matrix33<T>
Return a new matrix initialized with the values
passed
Sourcepub fn equal_with_abs_error(self, other: &Matrix33<T>, e: T) -> bool
pub fn equal_with_abs_error(self, other: &Matrix33<T>, e: T) -> bool
Compare 2 matrices for equality with absolute tolerance e
Sourcepub fn equal_with_rel_error(self, other: &Matrix33<T>, e: T) -> bool
pub fn equal_with_rel_error(self, other: &Matrix33<T>, e: T) -> bool
Compare 2 matrices for equality with relative tolerance e
Sourcepub fn translate(t: Vec2<T>) -> Matrix33<T>where
T: Real,
pub fn translate(t: Vec2<T>) -> Matrix33<T>where
T: Real,
Returns a new matrix specifying a translation of t
Sourcepub fn scale(s: Vec2<T>) -> Matrix33<T>where
T: Real,
pub fn scale(s: Vec2<T>) -> Matrix33<T>where
T: Real,
Returns a new matrix specifying a scale of s
Sourcepub fn rotate(r: T) -> Matrix33<T>where
T: Real,
pub fn rotate(r: T) -> Matrix33<T>where
T: Real,
Returns a new matrix specifying a rotation of r
Sourcepub fn transposed(self) -> Matrix33<T>
pub fn transposed(self) -> Matrix33<T>
Return the transpose of this matrix
Sourcepub fn determinant(self) -> T
pub fn determinant(self) -> T
Return the determinant of this matrix
Sourcepub fn transformp(self, v: Vec2<T>) -> Vec2<T>
pub fn transformp(self, v: Vec2<T>) -> Vec2<T>
Transform the Vec2 v
as a point
Sourcepub fn transformv(self, v: Vec2<T>) -> Vec2<T>
pub fn transformv(self, v: Vec2<T>) -> Vec2<T>
Transform the Vec2 v
as a vector
Sourcepub fn mult_vec_matrix(self, v: Vec2<T>) -> Vec2<T>
pub fn mult_vec_matrix(self, v: Vec2<T>) -> Vec2<T>
Wrapper for Imath’s confusingly named convention for matrix * point
Sourcepub fn mult_dir_matrix(self, v: Vec2<T>) -> Vec2<T>
pub fn mult_dir_matrix(self, v: Vec2<T>) -> Vec2<T>
Wrapper for Imath’s confusingly named convention for matrix * vector
Sourcepub fn gj_inverse(self) -> Option<Matrix33<T>>
pub fn gj_inverse(self) -> Option<Matrix33<T>>
Gauss-Jordan matrix inversion
Trait Implementations§
Source§impl<T> Index<usize> for Matrix33<T>where
T: Real,
Index operator. Returns a slice of the underlying matrix to allow
m[i][j]
indexing
impl<T> Index<usize> for Matrix33<T>where
T: Real,
Index operator. Returns a slice of the underlying matrix to allow
m[i][j]
indexing
Source§impl<T> IndexMut<usize> for Matrix33<T>where
T: Real,
Mutable Index operator. Returns a slice of the underlying matrix to allow
m[i][j]
indexing
impl<T> IndexMut<usize> for Matrix33<T>where
T: Real,
Mutable Index operator. Returns a slice of the underlying matrix to allow
m[i][j]
indexing