pub struct Mat23 {
pub x_axis: Vec2,
pub y_axis: Vec2,
pub z_axis: Vec2,
}
Expand description
A 2x3 column-major matrix.
Fields§
§x_axis: Vec2
The first column of the matrix.
y_axis: Vec2
The second column of the matrix.
z_axis: Vec2
The third column of the matrix.
Implementations§
Source§impl Mat23
impl Mat23
Sourcepub const fn from_cols(x_axis: Vec2, y_axis: Vec2, z_axis: Vec2) -> Self
pub const fn from_cols(x_axis: Vec2, y_axis: Vec2, z_axis: Vec2) -> Self
Creates a 2x3 matrix from two column vectors.
Sourcepub const fn from_cols_array(m: &[f32; 6]) -> Self
pub const fn from_cols_array(m: &[f32; 6]) -> Self
Creates a 2x3 matrix from an array stored in column major order.
Sourcepub const fn to_cols_array(&self) -> [f32; 6]
pub const fn to_cols_array(&self) -> [f32; 6]
Creates an array storing data in column major order.
Sourcepub const fn from_cols_array_2d(m: &[[f32; 2]; 3]) -> Self
pub const fn from_cols_array_2d(m: &[[f32; 2]; 3]) -> Self
Creates a 2x3 matrix from a 2D array stored in column major order.
Sourcepub const fn to_cols_array_2d(&self) -> [[f32; 2]; 3]
pub const fn to_cols_array_2d(&self) -> [[f32; 2]; 3]
Creates a 2D array storing data in column major order.
Sourcepub const fn from_cols_slice(slice: &[f32]) -> Self
pub const fn from_cols_slice(slice: &[f32]) -> Self
Creates a 2x3 matrix from the first 6 values in slice
.
§Panics
Panics if slice
is less than 6 elements long.
Sourcepub const fn from_rows(row0: Vec3, row1: Vec3) -> Self
pub const fn from_rows(row0: Vec3, row1: Vec3) -> Self
Creates a 2x3 matrix from two row vectors.
Sourcepub const fn from_rows_array(m: &[f32; 6]) -> Self
pub const fn from_rows_array(m: &[f32; 6]) -> Self
Creates a 2x3 matrix from an array stored in row major order.
Sourcepub const fn to_rows_array(&self) -> [f32; 6]
pub const fn to_rows_array(&self) -> [f32; 6]
Creates an array storing data in row major order.
Sourcepub const fn from_rows_array_2d(m: &[[f32; 3]; 2]) -> Self
pub const fn from_rows_array_2d(m: &[[f32; 3]; 2]) -> Self
Creates a 2x3 matrix from a 2D array stored in row major order.
Sourcepub const fn to_rows_array_2d(&self) -> [[f32; 3]; 2]
pub const fn to_rows_array_2d(&self) -> [[f32; 3]; 2]
Creates a 2D array storing data in row major order.
Sourcepub const fn from_rows_slice(slice: &[f32]) -> Self
pub const fn from_rows_slice(slice: &[f32]) -> Self
Creates a 2x3 matrix from the first 6 values in slice
.
§Panics
Panics if slice
is less than 6 elements long.
Sourcepub fn from_outer_product(a: Vec2, b: Vec3) -> Self
pub fn from_outer_product(a: Vec2, b: Vec3) -> Self
Creates a new 2x3 matrix from the outer product a * b^T
.
Sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns true
if, and only if, all elements are finite.
If any element is either NaN
or positive or negative infinity, this will return false
.
Sourcepub fn mul_symmetric_mat3(&self, rhs: &SymmetricMat3) -> Self
pub fn mul_symmetric_mat3(&self, rhs: &SymmetricMat3) -> Self
Multiplies self
by a symmetric 3x3 matrix, self * rhs
.
Sourcepub fn mul_transposed_mat23(&self, rhs: &Self) -> Mat2
pub fn mul_transposed_mat23(&self, rhs: &Self) -> Mat2
Multiplies self
by another matrix that is treated as transposed, self * rhs.transpose()
.
Sourcepub fn mul_scalar(&self, rhs: f32) -> Self
pub fn mul_scalar(&self, rhs: f32) -> Self
Multiplies a 2x3 matrix by a scalar.
Sourcepub fn div_scalar(&self, rhs: f32) -> Self
pub fn div_scalar(&self, rhs: f32) -> Self
Divides a 2x3 matrix by a scalar.
Trait Implementations§
Source§impl AddAssign<&Mat23> for Mat23
impl AddAssign<&Mat23> for Mat23
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+=
operation. Read moreSource§impl AddAssign for Mat23
impl AddAssign for Mat23
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl DivAssign<&f32> for Mat23
impl DivAssign<&f32> for Mat23
Source§fn div_assign(&mut self, rhs: &f32)
fn div_assign(&mut self, rhs: &f32)
/=
operation. Read moreSource§impl DivAssign<f32> for Mat23
impl DivAssign<f32> for Mat23
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/=
operation. Read moreSource§impl Mul<&Mat23> for &SymmetricMat2
impl Mul<&Mat23> for &SymmetricMat2
Source§impl Mul<&Mat23> for SymmetricMat2
impl Mul<&Mat23> for SymmetricMat2
Source§impl Mul<&SymmetricMat3> for &Mat23
impl Mul<&SymmetricMat3> for &Mat23
Source§impl Mul<&SymmetricMat3> for Mat23
impl Mul<&SymmetricMat3> for Mat23
Source§impl Mul<Mat23> for &SymmetricMat2
impl Mul<Mat23> for &SymmetricMat2
Source§impl Mul<Mat23> for SymmetricMat2
impl Mul<Mat23> for SymmetricMat2
Source§impl Mul<SymmetricMat3> for &Mat23
impl Mul<SymmetricMat3> for &Mat23
Source§impl Mul<SymmetricMat3> for Mat23
impl Mul<SymmetricMat3> for Mat23
Source§impl MulAssign<&f32> for Mat23
impl MulAssign<&f32> for Mat23
Source§fn mul_assign(&mut self, rhs: &f32)
fn mul_assign(&mut self, rhs: &f32)
*=
operation. Read moreSource§impl MulAssign<f32> for Mat23
impl MulAssign<f32> for Mat23
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*=
operation. Read moreSource§impl SubAssign<&Mat23> for Mat23
impl SubAssign<&Mat23> for Mat23
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-=
operation. Read moreSource§impl SubAssign for Mat23
impl SubAssign for Mat23
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more