pub struct Matrix3x3 { /* private fields */ }Expand description
Matrice 3×3 en f32, stockée en row-major.
use embedded_matrix::Matrix3x3;
let m = Matrix3x3::identity();
assert!((m.det() - 1.0).abs() < 1e-5);
assert!((m.trace() - 3.0).abs() < 1e-5);Implementations§
Source§impl Matrix3x3
impl Matrix3x3
Sourcepub const fn new(data: [[f32; 3]; 3]) -> Self
pub const fn new(data: [[f32; 3]; 3]) -> Self
Crée une matrice à partir d’un tableau row-major.
Sourcepub fn get(&self, row: usize, col: usize) -> f32
pub fn get(&self, row: usize, col: usize) -> f32
Retourne l’élément à la ligne row et colonne col (0-indexé).
Sourcepub fn inv(&self) -> Result<Self, MatrixError>
pub fn inv(&self) -> Result<Self, MatrixError>
Inverse par la méthode des cofacteurs.
Retourne Err(MatrixError::SingularMatrix) si |det| < 1e-7.
Trait Implementations§
impl Copy for Matrix3x3
impl StructuralPartialEq for Matrix3x3
Auto Trait Implementations§
impl Freeze for Matrix3x3
impl RefUnwindSafe for Matrix3x3
impl Send for Matrix3x3
impl Sync for Matrix3x3
impl Unpin for Matrix3x3
impl UnsafeUnpin for Matrix3x3
impl UnwindSafe for Matrix3x3
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