pub struct Matrix4 {}Expand description
A 4x4 matrix stored in row-major order.
§Examples
use use_matrix::Matrix4;
let matrix = Matrix4::from_rows([
[2.0, 1.0, 0.0, 0.0],
[0.0, 3.0, 4.0, 0.0],
[0.0, 0.0, 5.0, 6.0],
[0.0, 0.0, 0.0, 7.0],
]);
assert_eq!(matrix.determinant(), 210.0);Fields§
§m00: f64§m01: f64§m02: f64§m03: f64§m10: f64§m11: f64§m12: f64§m13: f64§m20: f64§m21: f64§m22: f64§m23: f64§m30: f64§m31: f64§m32: f64§m33: f64Implementations§
Source§impl Matrix4
impl Matrix4
Sourcepub const IDENTITY: Self
pub const IDENTITY: Self
The identity matrix.
§Examples
use use_matrix::Matrix4;
let matrix = Matrix4::from_rows([
[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0],
[2.0, 0.0, 1.0, 3.0],
[4.0, 1.0, 0.0, 2.0],
]);
assert_eq!(Matrix4::IDENTITY * matrix, matrix);Sourcepub const fn new(
m00: f64,
m01: f64,
m02: f64,
m03: f64,
m10: f64,
m11: f64,
m12: f64,
m13: f64,
m20: f64,
m21: f64,
m22: f64,
m23: f64,
m30: f64,
m31: f64,
m32: f64,
m33: f64,
) -> Self
pub const fn new( m00: f64, m01: f64, m02: f64, m03: f64, m10: f64, m11: f64, m12: f64, m13: f64, m20: f64, m21: f64, m22: f64, m23: f64, m30: f64, m31: f64, m32: f64, m33: f64, ) -> Self
Creates a matrix from row-major entries.
Sourcepub const fn determinant(self) -> f64
pub const fn determinant(self) -> f64
Returns the determinant.
Trait Implementations§
impl Copy for Matrix4
impl StructuralPartialEq for Matrix4
Auto Trait Implementations§
impl Freeze for Matrix4
impl RefUnwindSafe for Matrix4
impl Send for Matrix4
impl Sync for Matrix4
impl Unpin for Matrix4
impl UnsafeUnpin for Matrix4
impl UnwindSafe for Matrix4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more