Trait nannou::math::SquareMatrix [−][src]
pub trait SquareMatrix: One<Output = Self::ColumnRow, Output = Self> + Product<Self> + Matrix<Column = Self::ColumnRow, Row = Self::ColumnRow, Transpose = Self> + Mul<Self::ColumnRow> + Mul<Self> where
Self::Scalar: BaseFloat, { type ColumnRow: VectorSpace + Array; pub fn from_value(value: Self::Scalar) -> Self; pub fn from_diagonal(diagonal: Self::ColumnRow) -> Self; pub fn transpose_self(&mut self); pub fn determinant(&self) -> Self::Scalar; pub fn diagonal(&self) -> Self::ColumnRow; pub fn invert(&self) -> Option<Self>; pub fn is_diagonal(&self) -> bool; pub fn is_symmetric(&self) -> bool; pub fn identity() -> Self { ... } pub fn trace(&self) -> Self::Scalar { ... } pub fn is_invertible(&self) -> bool { ... } pub fn is_identity(&self) -> bool { ... } }
A column-major major matrix where the rows and column vectors are of the same dimensions.
Associated Types
type ColumnRow: VectorSpace + Array
[src]
The row/column vector of the matrix.
This is used to constrain the column and rows to be of the same type in lieu of equality
constraints being implemented for where
clauses. Once those are added, this type will
likely go away.
Required methods
pub fn from_value(value: Self::Scalar) -> Self
[src]
Create a new diagonal matrix using the supplied value.
pub fn from_diagonal(diagonal: Self::ColumnRow) -> Self
[src]
Create a matrix from a non-uniform scale
pub fn transpose_self(&mut self)
[src]
Transpose this matrix in-place.
pub fn determinant(&self) -> Self::Scalar
[src]
Take the determinant of this matrix.
pub fn diagonal(&self) -> Self::ColumnRow
[src]
Return a vector containing the diagonal of this matrix.
pub fn invert(&self) -> Option<Self>
[src]
Invert this matrix, returning a new matrix. m.mul_m(m.invert())
is
the identity matrix. Returns None
if this matrix is not invertible
(has a determinant of zero).
pub fn is_diagonal(&self) -> bool
[src]
Test if this is a diagonal matrix. That is, every element outside of the diagonal is 0.
pub fn is_symmetric(&self) -> bool
[src]
Test if this matrix is symmetric. That is, it is equal to its transpose.
Provided methods
pub fn identity() -> Self
[src]
The identity matrix. Multiplying this matrix with another should have no effect.
Note that this is exactly the same as One::one
. The term ‘identity
matrix’ is more common though, so we provide this method as an
alternative.
pub fn trace(&self) -> Self::Scalar
[src]
Return the trace of this matrix. That is, the sum of the diagonal.
pub fn is_invertible(&self) -> bool
[src]
Test if this matrix is invertible.
pub fn is_identity(&self) -> bool
[src]
Test if this matrix is the identity matrix. That is, it is diagonal and every element in the diagonal is one.
Implementors
impl<S> SquareMatrix for Matrix2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type ColumnRow = Vector2<S>
pub fn from_value(value: S) -> Matrix2<S>
[src]
pub fn from_diagonal(value: Vector2<S>) -> Matrix2<S>
[src]
pub fn transpose_self(&mut self)
[src]
pub fn determinant(&self) -> S
[src]
pub fn diagonal(&self) -> Vector2<S>
[src]
pub fn invert(&self) -> Option<Matrix2<S>>
[src]
pub fn is_diagonal(&self) -> bool
[src]
pub fn is_symmetric(&self) -> bool
[src]
impl<S> SquareMatrix for Matrix3<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type ColumnRow = Vector3<S>
pub fn from_value(value: S) -> Matrix3<S>
[src]
pub fn from_diagonal(value: Vector3<S>) -> Matrix3<S>
[src]
pub fn transpose_self(&mut self)
[src]
pub fn determinant(&self) -> S
[src]
pub fn diagonal(&self) -> Vector3<S>
[src]
pub fn invert(&self) -> Option<Matrix3<S>>
[src]
pub fn is_diagonal(&self) -> bool
[src]
pub fn is_symmetric(&self) -> bool
[src]
impl<S> SquareMatrix for Matrix4<S> where
S: BaseFloat,
[src]
S: BaseFloat,