Matrix3 Struct Reference

A 3x3 matrix class for 2D operations (similar to Matrix4). More...

List of all members.

Public Member Functions

 Matrix3 (Vector3 valx, Vector3 valy, Vector3 valz)
 Constructor.
Matrix3 Transpose ()
 Return the transpose.
float Determinant ()
 Return the determinant.
Matrix3 Inverse ()
 Return the general inverse.
Matrix3 InverseOrthonormal ()
 Special inverse that assumes the matrix is a TxR (orthonormal).
Matrix4 Matrix4 ()
 Assuming this matrix is a transform matrix (last row=0,0,1 etc), return a Matrix4 version of it.
string GetCoordSysError ()
 Get the last error returned by isCoordSys() as a string.
bool IsOrthonormal (float epsilon)
 Return true if the matrix represents a valid right-handed, orthogonal 2d coordinate system.
bool Equals (ref Matrix3 m, float epsilon)
 Equality test.
bool Equals (ref Matrix3 m)
 Equality test.

Static Public Member Functions

static Vector3 operator* (Matrix3 m, Vector3 v)
 Matrix/vector multiplication.
static Matrix3 operator* (Matrix3 m1, Matrix3 m2)
 Matrix/matrix multiplication.
static Matrix3 Translation (Vector2 value)
 Return a translation matrix.
static Matrix3 Scale (Vector2 value)
 Return a scale matrix.
static Matrix3 Skew (Vector2 value)
 Return a skew matrix.
static Matrix3 Rotation (Vector2 unit_vector)
 Return a rotation matrix.
static Matrix3 Rotation (float angle)
 Return a rotation matrix.
static Matrix3 TRS (Vector2 translation, Vector2 unit_vector, Vector2 scale)
 Return a Translation * Rotation * Scale transform node.

Public Attributes

Vector3 X
 First column.
Vector3 Y
 Second column.
Vector3 Z
 Third column.

Static Public Attributes

static Matrix3 Identity
 Return the identity.
static Matrix3 Zero
 Return the matrix with all elements set to zero.

Detailed Description

A 3x3 matrix class for 2D operations (similar to Matrix4).


Constructor & Destructor Documentation

Matrix3 ( Vector3  valx,
Vector3  valy,
Vector3  valz 
)

Constructor.

Parameters:
valxFirst column.
valySecond column.
valzThird column.

Member Function Documentation

static Matrix3 Rotation ( float  angle) [static]

Return a rotation matrix.

Parameters:
angleRotation angle in radians.
static Matrix3 Rotation ( Vector2  unit_vector) [static]

Return a rotation matrix.

Parameters:
unit_vectorA (cos(angle),sin(angle)) unit vector, where angle is the amount you want to rotate by.
static Matrix3 Skew ( Vector2  value) [static]

Return a skew matrix.

Parameters:
valueThe (tan(skewx),tan(skewy)) vector, where skewx and skewy are the skew angles.
static Matrix3 TRS ( Vector2  translation,
Vector2  unit_vector,
Vector2  scale 
) [static]

Return a Translation * Rotation * Scale transform node.

Parameters:
translationThe translation amount.
unit_vectorA (cos(angle),sin(angle)) unit vector, where angle is the amount you want to rotate by.
scaleThe scale amount.