ASL
|
A Matrix3 is a 3x3 matrix useful for representing affine transformations in 2D space.
#include <Matrix3.h>
Public Member Functions | |
int | rows () const |
Returns the nubmer of rows of this matrix (3) | |
int | cols () const |
Returns the nubmer of columns of this matrix (3) | |
T | trace () const |
Returns the trace of this matrix. | |
Matrix3_ (T a00, T a01, T a02, T a10, T a11, T a12, T a20=0, T a21=0, T a22=1) | |
Constructs a 3x3 matrix given its elements (by rows). | |
Matrix3_ (const T *m, bool colmajor=false) | |
Constructs a matrix from elements pointed by m, row-major (default) or column-major. | |
template<class T2 > | |
Matrix3_< T2 > | with () const |
Returns a copy of this matrix with elements converted to the given type. | |
Matrix3_ | transposed () const |
Returns this matrix transposed. | |
T & | operator() (int i, int j) |
Returns the element at row i , column j . | |
Vec2_< T > | operator* (const Vec2_< T > &v) const |
Returns vector v left-multiplied by this matrix (only two components, to apply an affine transform). | |
Vec3_< T > | operator* (const Vec3_< T > &v) const |
Returns vector v transformed by this affine transform. | |
Vec2_< T > | operator^ (const Vec2_< T > &v) const |
Returns vector v transformed by this projective transform. | |
Matrix3_ | operator* (T t) const |
Returns this matrix multiplied by scalar t. | |
Matrix3_ | operator+ (const Matrix3_ &B) const |
Returns the sum of this matrix and B. | |
Matrix3_ | operator* (const Matrix3_ &B) const |
Returns this matrix multiplied by matrix B. | |
Vec2_< T > | column2 (int i) const |
Returns the i-th column's top 2 elements as a Vec2. | |
Vec3_< T > | column (int i) const |
Returns the i-th column as a Vec3. | |
Vec2_< T > | translation () const |
Returns the translation part of this matrix (the last column) as a Vec2. | |
Matrix3_ & | setTranslation (const Vec2_< T > &t) |
Sets the translation part of this matrix (the last column) | |
T | rotation () const |
Returns the rotation part of this matrix (assuming there is no skew) | |
Matrix3_ | inverse () const |
Returns the inverse of this matrix. | |
T | det () const |
Returns the determinant of this matrix. | |
T | normSq () const |
Returns the matrix Frobenius norm squared. | |
T | norm () const |
Returns the matrix Frobenius norm. | |
Static Public Member Functions | |
static Matrix3_ | identity () |
Returns the 3x3 identity matrix. | |
static Matrix3_ | rotate (T t) |
Returns a 2D rotation matrix for angle t. | |
static Matrix3_ | translate (const Vec2_< T > &t) |
Returns a 2D translation matrix for vector t. | |
static Matrix3_ | scale (T t) |
Returns a 2D scale matrix for factor t. | |