pub struct Mat3 {
pub data: [f64; 9],
}Expand description
A 3x3 matrix. Data and operations are column-major.
Fields§
§data: [f64; 9]Implementations§
Source§impl Mat3
impl Mat3
pub fn new(data: [f64; 9]) -> Self
pub const fn new_identity() -> Self
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
Calculate the matrix’s determinant.
pub fn inverse(&self) -> Option<Self>
Sourcepub fn eigen_vecs_vals(&self) -> (Mat3, Vec3)
pub fn eigen_vecs_vals(&self) -> (Mat3, Vec3)
Symmetric 3x3 eigen-decomposition (Jacobi). Returns (V, λ) where columns of V are eigenvectors and λ=(λx,λy,λz). Input must be symmetric (e.g., inertia tensor).
Sourcepub fn solve_system(&self, b_in: Vec3) -> Vec3
pub fn solve_system(&self, b_in: Vec3) -> Vec3
Solve A x = b (3x3) via LU with partial pivoting. Good for SPD matrices (e.g., inertia).
pub fn to_arr(&self) -> [[f64; 3]; 3]
pub fn from_arr(a: [[f64; 3]; 3]) -> Mat3
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mat3
impl RefUnwindSafe for Mat3
impl Send for Mat3
impl Sync for Mat3
impl Unpin for Mat3
impl UnsafeUnpin for Mat3
impl UnwindSafe for Mat3
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