pub struct Matrix2x2 { /* private fields */ }Expand description
Matrice 2×2 en f32, stockée en row-major.
use embedded_matrix::Matrix2x2;
let m = Matrix2x2::new([[1.0, 2.0], [3.0, 4.0]]);
assert!((m.det() - (-2.0)).abs() < 1e-5);Implementations§
Source§impl Matrix2x2
impl Matrix2x2
Sourcepub const fn new(data: [[f32; 2]; 2]) -> Self
pub const fn new(data: [[f32; 2]; 2]) -> 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 de la matrice.
Retourne Err(MatrixError::SingularMatrix) si le déterminant est nul
(seuil : |det| < 1e-7).
Trait Implementations§
impl Copy for Matrix2x2
impl StructuralPartialEq for Matrix2x2
Auto Trait Implementations§
impl Freeze for Matrix2x2
impl RefUnwindSafe for Matrix2x2
impl Send for Matrix2x2
impl Sync for Matrix2x2
impl Unpin for Matrix2x2
impl UnsafeUnpin for Matrix2x2
impl UnwindSafe for Matrix2x2
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