Struct iron_shapes::matrix3d::Matrix3d
source · pub struct Matrix3d<T: CoordinateType> {
pub m11: T,
pub m12: T,
pub m13: T,
pub m21: T,
pub m22: T,
pub m23: T,
pub m31: T,
pub m32: T,
pub m33: T,
}Expand description
3x3 matrix of the form.
[[ m11, m12, m13 ],
[ m21, m22, m23 ],
[ m31, m32, m33 ]]
Fields§
§m11: Tm11
m12: Tm12
m13: Tm13
m21: Tm21
m22: Tm22
m23: Tm23
m31: Tm31
m32: Tm32
m33: Tm33
Implementations§
source§impl<T> Matrix3d<T>where
T: CoordinateType,
impl<T> Matrix3d<T>where T: CoordinateType,
sourcepub fn new(
[[m11, m12, m13], [m21, m22, m23], [m31, m32, m33]]: [[T; 3]; 3]
) -> Self
pub fn new( [[m11, m12, m13], [m21, m22, m23], [m31, m32, m33]]: [[T; 3]; 3] ) -> Self
Create a new 3x3 matrix with entries of the form:
[[ m11, m12, m13 ],
[ m21, m22, m23 ],
[ m31, m32, m33 ]]
sourcefn new_from_flat([m11, m12, m13, m21, m22, m23, m31, m32, m33]: [T; 9]) -> Self
fn new_from_flat([m11, m12, m13, m21, m22, m23, m31, m32, m33]: [T; 9]) -> Self
Create a new 3x3 matrix with entries of the form:
[[ m11, m12, m13 ],
[ m21, m22, m23 ],
[ m31, m32, m33 ]]
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: &(T, T, T)) -> (T, T, T)
pub fn mul_column_vector(&self, rhs: &(T, T, T)) -> (T, T, T)
Compute multiplication with a column vector A*rhs.
sourcepub fn mul_matrix(&self, rhs: &Self) -> Self
pub fn mul_matrix(&self, rhs: &Self) -> Self
Matrix-matrix multiplication.
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 determinant(&self) -> T
pub fn determinant(&self) -> T
Compute the determinant of this matrix.
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§
source§impl<T: CoordinateType> Default for Matrix3d<T>
impl<T: CoordinateType> Default for Matrix3d<T>
source§impl<'de, T> Deserialize<'de> for Matrix3d<T>where
T: Deserialize<'de> + CoordinateType,
impl<'de, T> Deserialize<'de> for Matrix3d<T>where T: Deserialize<'de> + CoordinateType,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more