Expand description
2x2 and 3x3 f32 matrices for no_std embedded systems,
powered by embedded-matrix.
Provides Matrix2x2 and Matrix3x3 with native operators (+, -, *,
unary -, matrix-vector multiplication, +=, -=, *=), determinant,
trace, transpose, inversion (inv), and linear system solving (solve)
without heap allocation, libm, or unsafe.
§Behavior & Notes
| Operation / Input | Behavior |
|---|---|
Matrix2x2::new / Matrix3x3::new | Builds from row-major [[f32; N]; N] (identity, zero, from_diagonal) |
inv() | Returns Result<M, MatrixError> using a scale-relative singularity check |
solve(b) | Solves A * x = b -> Result<[f32; N], MatrixError> |
rotation / rotation_x/y/z | Available when the trig feature is enabled on embedded-matrix |
| Singular matrix | Returns Err(MatrixError::SingularMatrix) |
NaN, ±Infinity, or overflow | Returns Err(MatrixError::NonFiniteValue) |
Structs§
- Matrix2x2
- A 2×2
f32matrix stored in row-major order. - Matrix3x3
- A 3×3
f32matrix stored in row-major order.
Enums§
- Matrix
Error - Error returned when a matrix operation is invalid.