Expand description
Implements a matrix 2 x 2
Identity Matrrix NxN, where all elements Uij that i = j are 1
Matrix determinant
use mathf::matrix::{Matrix2x2};
let matrix = Matrix2x2::new_idx(4.0, -3.0, 0.0, 2.0);
assert_eq!(matrix.det(), 8f32);
Transforms a MatrixNxN into a Vec<Vec> by row
use mathf::matrix::{Matrix2x2};
let matrix = Matrix2x2::new_idx(4.0, -3.0, 0.0, 2.0);
assert_eq!(matrix.vectorize(), vec![
vec![4.0, -3.0], vec![0.0, 2.0]
]);
Same as determinant for Matrix 2x2
Transpose of Matrix NxN.
Transpose switches rows and columns
Matrix inverse
use mathf::matrix::{Matrix2x2};
let matrix = Matrix2x2::new_idx(4.0, 7.0, 2.0, 6.0);
let matrix_inverse = Matrix2x2::new_idx(0.6, -0.7, -0.2, 0.4);
assert_eq!(matrix.inverse(0.001).unwrap(), matrix_inverse);
A matrix is orthogonal if and only if transpose(A) == inverse(A)
Creates a new Matrix2x2 from 2 vector2 rows
Creates a new Matrix2x2 from 4 indexed floats
2D rotation Matrix by angle teta (radians)
For matrix 2x2:
Implements the &Matrix 2x2 ‘+’ trait
The resulting type after applying the +
operator.
Implements the Matrix 2x2 ‘+’ trait
The resulting type after applying the +
operator.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Implements the Matrix 2x2 ‘/’ trait for Matrix2x2 / f32
so that (identity / value).det() == valueˆ2
.
The resulting type after applying the /
operator.
Implements the Matrix 2x2 ‘/’ trait for &Matrix2x2 / f32
so that (identity / value).det() == valueˆ2
.
The resulting type after applying the /
operator.
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Implements the &Matrix 2x2 ‘*’ trait for &Matrix2x2 * f32
so that (value * identity).det() == valueˆ2
and ßM == Mß
˜.
The resulting type after applying the *
operator.
Implements the transform matrix of a vector 2 into another vector 2.
The order should be matrix * &point because of 2x2 * 2x1 = 2x1
The resulting type after applying the *
operator.
Implements the transform matrix of a point 2 into another point 2.
The order should be matrix * point because of 2x2 * 2x1 = 2x1
The resulting type after applying the *
operator.
Implements the transform matrix of a vector 2 into another vector 2.
The order should be matrix * &vector because of 2x2 * 2x1 = 2x1
The resulting type after applying the *
operator.
Implements the transform matrix of a vector 2 into another vector 2.
The order should be matrix * vector because of 2x2 * 2x1 = 2x1
The resulting type after applying the *
operator.
Implements the Matrix 2x2 ‘*’ trait for Matrix2x2 * f32
so that (value * identity).det() == valueˆ2
and ßM == Mß
˜.
The resulting type after applying the *
operator.
Implements the Matrix 2x2 ‘*’ trait for Matrix2x2 * Matrix2x2
The resulting type after applying the *
operator.
Implements the transform matrix of a vector 2 into another vector 2.
The order should be matrix * vector because of 2x2 * 2x1 = 2x1
The resulting type after applying the *
operator.
Implements the Matrix 2x2 ‘*’ trait for Matrix2x2 * f32
so that (identity * value).det() == valueˆ2
.
The resulting type after applying the *
operator.
Implements the &Matrix 2x2 ‘*’ trait for &Matrix2x2 * f32
so that (identity * value).det() == valueˆ2
.
The resulting type after applying the *
operator.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.