pub struct Matrix<const M: usize, const N: usize, T: Sized + Copy + Default> {
pub values: [[T; N]; M],
}Fields§
§values: [[T; N]; M]Implementations§
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default> Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> Matrix<M, N, T>
pub const fn new(values: [[T; N]; M]) -> Matrix<M, N, T>
Sourcepub fn submatrix(
&self,
rmin: usize,
rmax: usize,
cmin: usize,
cmax: usize,
) -> Matrix<M, N, T>
pub fn submatrix( &self, rmin: usize, rmax: usize, cmin: usize, cmax: usize, ) -> Matrix<M, N, T>
Returns only a subpart of the matrix
pub fn augment<const O: usize, const R: usize>( &self, other: &Matrix<M, O, T>, ) -> Matrix<M, R, T>
Source§impl<const M: usize, const N: usize, T: Default + Copy + Zero + AddAssign + Mul<Output = T>> Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Default + Copy + Zero + AddAssign + Mul<Output = T>> Matrix<M, N, T>
Source§impl Matrix<2, 2, f64>
impl Matrix<2, 2, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<2, 2, f64>
Source§impl Matrix<3, 3, f64>
impl Matrix<3, 3, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<3, 3, f64>
Source§impl Matrix<4, 4, f64>
impl Matrix<4, 4, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<4, 4, f64>
Source§impl Matrix<5, 5, f64>
impl Matrix<5, 5, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<5, 5, f64>
Source§impl Matrix<6, 6, f64>
impl Matrix<6, 6, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<6, 6, f64>
Source§impl Matrix<7, 7, f64>
impl Matrix<7, 7, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<7, 7, f64>
Source§impl Matrix<8, 8, f64>
impl Matrix<8, 8, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<8, 8, f64>
Source§impl Matrix<9, 9, f64>
impl Matrix<9, 9, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<9, 9, f64>
Source§impl Matrix<10, 10, f64>
impl Matrix<10, 10, f64>
pub fn lup_decompose(&self) -> LUPDecomposition<10, 10, f64>
Source§impl Matrix<2, 2, f64>
impl Matrix<2, 2, f64>
pub fn rotation_counterclockwise(angle: f64) -> Self
pub fn rotate_counterclockwise(&self, angle: f64) -> Self
pub fn rotation_clockwise(angle: f64) -> Self
pub fn rotate_clockwise(&self, angle: f64) -> Self
pub fn sheered_x(factor: f64) -> Self
pub fn sheer_x(&self, factor: f64) -> Self
pub const fn sheered_y(factor: f64) -> Self
pub fn sheer_y(&self, factor: f64) -> Self
pub const fn scaled_x(factor: f64) -> Self
pub fn scale_x(&self, factor: f64) -> Self
pub const fn scaled_y(factor: f64) -> Self
pub fn scale_y(&self, factor: f64) -> Self
pub const fn scaled(factor: f64) -> Self
pub fn scale(&self, factor: f64) -> Self
pub const fn reflected() -> Self
pub fn reflect(&self) -> Self
pub const fn reflected_x() -> Self
pub fn reflect_x(&self) -> Self
pub const fn reflected_y() -> Self
pub fn reflect_y(&self) -> Self
Source§impl<T: Copy + Default + FloatExt<Type = T> + One + Zero + Neg<Output = T> + Add + AddAssign<T> + Mul<Output = T>> Matrix<3, 1, T>
impl<T: Copy + Default + FloatExt<Type = T> + One + Zero + Neg<Output = T> + Add + AddAssign<T> + Mul<Output = T>> Matrix<3, 1, T>
pub fn translate(&self, x: T, y: T) -> Self
pub fn rotate_x(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotate_y(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotate_z(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotate_zyx(&self, x_angle: T, y_angle: T, z_angle: T) -> Self
Available on crate feature
std only.Source§impl<T: Copy + Default + FloatExt<Type = T> + One + Zero + Neg<Output = T> + Add + AddAssign<T> + Mul<Output = T>> Matrix<3, 3, T>
impl<T: Copy + Default + FloatExt<Type = T> + One + Zero + Neg<Output = T> + Add + AddAssign<T> + Mul<Output = T>> Matrix<3, 3, T>
pub fn rotated_x(angle: T) -> Self
Available on crate feature
std only.pub fn rotate_x(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotated_y(angle: T) -> Self
Available on crate feature
std only.pub fn rotate_y(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotated_z(angle: T) -> Self
Available on crate feature
std only.pub fn rotate_z(&self, angle: T) -> Self
Available on crate feature
std only.pub fn rotated_zyx(x_angle: T, y_angle: T, z_angle: T) -> Self
Available on crate feature
std only.pub fn rotate_zyx(&self, x_angle: T, y_angle: T, z_angle: T) -> Self
Available on crate feature
std only.pub const fn scaled_x(factor: T) -> Self
Available on crate feature
std only.pub fn scale_x(&self, factor: T) -> Self
Available on crate feature
std only.pub const fn scaled_y(factor: T) -> Self
Available on crate feature
std only.pub fn scale_y(&self, factor: T) -> Self
Available on crate feature
std only.pub const fn scaled_z(factor: T) -> Self
Available on crate feature
std only.pub fn scale_z(&self, factor: T) -> Self
Available on crate feature
std only.Trait Implementations§
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default + Add<Output = T>> Add for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default + Add<Output = T>> Add for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Clone + Sized + Copy + Default> Clone for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Clone + Sized + Copy + Default> Clone for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Debug + Sized + Copy + Default> Debug for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Debug + Sized + Copy + Default> Debug for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default> From<&[[T; N]; M]> for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> From<&[[T; N]; M]> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default> From<[[T; N]; M]> for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> From<[[T; N]; M]> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default> Index<usize> for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> Index<usize> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default> IndexMut<usize> for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> IndexMut<usize> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for &Matrix<M, N, T>
impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for &Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for &mut Matrix<M, N, T>
impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for &mut Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for Matrix<M, N, T>
impl<const M: usize, const N: usize, const P: usize, T: Sized + Copy + Default + Add + Mul + AddAssign<<T as Mul<T>>::Output>> Mul<Matrix<N, P, T>> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default + Mul<T, Output = T>> Mul<T> for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default + Mul<T, Output = T>> Mul<T> for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: PartialEq + Sized + Copy + Default> PartialEq for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: PartialEq + Sized + Copy + Default> PartialEq for Matrix<M, N, T>
Source§impl<const M: usize, const N: usize, T: Sized + Copy + Default + Add<Output = T> + Mul<T, Output = T> + ToSigned<Output = T>> Sub for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default + Add<Output = T> + Mul<T, Output = T> + ToSigned<Output = T>> Sub for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Copy + Sized + Copy + Default> Copy for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Eq + Sized + Copy + Default> Eq for Matrix<M, N, T>
impl<const M: usize, const N: usize, T: Sized + Copy + Default> StructuralPartialEq for Matrix<M, N, T>
Auto Trait Implementations§
impl<const M: usize, const N: usize, T> Freeze for Matrix<M, N, T>where
T: Freeze,
impl<const M: usize, const N: usize, T> RefUnwindSafe for Matrix<M, N, T>where
T: RefUnwindSafe,
impl<const M: usize, const N: usize, T> Send for Matrix<M, N, T>where
T: Send,
impl<const M: usize, const N: usize, T> Sync for Matrix<M, N, T>where
T: Sync,
impl<const M: usize, const N: usize, T> Unpin for Matrix<M, N, T>where
T: Unpin,
impl<const M: usize, const N: usize, T> UnwindSafe for Matrix<M, N, T>where
T: UnwindSafe,
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