Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Matrix3 Class Reference

3x3 matrix. More...

#include <Matrix3.h>

List of all members.

Public Member Functions

void deserialize (class BinaryInput &b)
float determinant () const
void eigenSolveSymmetric (float afEigenvalue[3], Vector3 akEigenvector[3]) const
bool fuzzyEq (const Matrix3 &b) const
Vector3 getColumn (int iCol) const
Vector3 getRow (int iRow) const
Matrix3 inverse (float fTolerance=1e-06) const
bool inverse (Matrix3 &rkInverse, float fTolerance=1e-06) const
bool isOrthonormal () const
 Matrix3 (const class Quat &q)
 Matrix3 (float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
 Matrix3 (const Matrix3 &rkMatrix)
 Matrix3 (const float aafEntry[3][3])
 Matrix3 (class BinaryInput &b)
 Matrix3 ()
Matrix3 operator * (float fScalar) const
Vector3 operator * (const Vector3 &v) const
Matrix3 operator * (const Matrix3 &rkMatrix) const
Matrix3operator *= (const Matrix3 &rkMatrix)
 operator const float * () const
 operator float * ()
bool operator!= (const Matrix3 &rkMatrix) const
Matrix3 operator+ (const Matrix3 &rkMatrix) const
Matrix3operator+= (const Matrix3 &rkMatrix)
Matrix3 operator- () const
Matrix3 operator- (const Matrix3 &rkMatrix) const
Matrix3operator-= (const Matrix3 &rkMatrix)
Matrix3operator= (const Matrix3 &rkMatrix)
bool operator== (const Matrix3 &rkMatrix) const
const float * operator[] (int iRow) const
float * operator[] (int iRow)
void orthonormalize ()
void qDUDecomposition (Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) const
void serialize (class BinaryOutput &b) const
void set (float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
void setColumn (int iCol, const Vector3 &vector)
void setRow (int iRow, const Vector3 &vector)
void singularValueComposition (const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
void singularValueDecomposition (Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
float spectralNorm () const
void toAxisAngle (Vector3 &rkAxis, float &rfRadians) const
bool toEulerAnglesXYZ (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
bool toEulerAnglesXZY (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
bool toEulerAnglesYXZ (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
bool toEulerAnglesYZX (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
bool toEulerAnglesZXY (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
bool toEulerAnglesZYX (float &rfYAngle, float &rfPAngle, float &rfRAngle) const
std::string toString () const
Matrix3 transpose () const

Static Public Member Functions

static Matrix3 fromAxisAngle (const Vector3 &rkAxis, float fRadians)
static Matrix3 fromEulerAnglesXYZ (float fYAngle, float fPAngle, float fRAngle)
static Matrix3 fromEulerAnglesXZY (float fYAngle, float fPAngle, float fRAngle)
static Matrix3 fromEulerAnglesYXZ (float fYAngle, float fPAngle, float fRAngle)
static Matrix3 fromEulerAnglesYZX (float fYAngle, float fPAngle, float fRAngle)
static Matrix3 fromEulerAnglesZXY (float fYAngle, float fPAngle, float fRAngle)
static Matrix3 fromEulerAnglesZYX (float fYAngle, float fPAngle, float fRAngle)
static const Matrix3identity ()
static void mul (const Matrix3 &A, const Matrix3 &B, Matrix3 &out)
static void tensorProduct (const Vector3 &rkU, const Vector3 &rkV, Matrix3 &rkProduct)
static void transpose (const Matrix3 &A, Matrix3 &out)
static const Matrix3zero ()

Static Public Attributes

static const float EPSILON

Protected Member Functions

bool qLAlgorithm (float afDiag[3], float afSubDiag[3])
void tridiagonal (float afDiag[3], float afSubDiag[3])

Static Protected Member Functions

static void bidiagonalize (Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
static void golubKahanStep (Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
static float maxCubicRoot (float afCoeff[3])

Static Protected Attributes

static const float ms_fSvdEpsilon
static const int ms_iSvdMaxIterations

Friends

Matrix3 operator * (int fScalar, const Matrix3 &rkMatrix)
Matrix3 operator * (float fScalar, const Matrix3 &rkMatrix)
Matrix3 operator * (double fScalar, const Matrix3 &rkMatrix)
Vector3 operator * (const Vector3 &rkVector, const Matrix3 &rkMatrix)


Detailed Description

3x3 matrix.

Do not subclass.


Constructor & Destructor Documentation

G3D::Matrix3::Matrix3 (  )  [inline]

Initial values are undefined for performance.

See also Matrix3::zero(), Matrix3::identity(), Matrix3::fromAxisAngle, etc.

G3D::Matrix3::Matrix3 ( class BinaryInput b  ) 

G3D::Matrix3::Matrix3 ( const float  aafEntry[3][3]  ) 

G3D::Matrix3::Matrix3 ( const Matrix3 rkMatrix  ) 

G3D::Matrix3::Matrix3 ( float  fEntry00,
float  fEntry01,
float  fEntry02,
float  fEntry10,
float  fEntry11,
float  fEntry12,
float  fEntry20,
float  fEntry21,
float  fEntry22 
)

G3D::Matrix3::Matrix3 ( const class Quat q  ) 

Constructs a matrix from a quaternion.

Referenced Code:
Graphics Gems II, p. 351--354
Referenced Code:
Implementation from Watt and Watt, pg 362


Member Function Documentation

static void G3D::Matrix3::bidiagonalize ( Matrix3 kA,
Matrix3 kL,
Matrix3 kR 
) [static, protected]

void G3D::Matrix3::deserialize ( class BinaryInput b  ) 

float G3D::Matrix3::determinant (  )  const

void G3D::Matrix3::eigenSolveSymmetric ( float  afEigenvalue[3],
Vector3  akEigenvector[3] 
) const

eigensolver, matrix must be symmetric

static Matrix3 G3D::Matrix3::fromAxisAngle ( const Vector3 rkAxis,
float  fRadians 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesXYZ ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesXZY ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesYXZ ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesYZX ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesZXY ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

static Matrix3 G3D::Matrix3::fromEulerAnglesZYX ( float  fYAngle,
float  fPAngle,
float  fRAngle 
) [static]

bool G3D::Matrix3::fuzzyEq ( const Matrix3 b  )  const

Vector3 G3D::Matrix3::getColumn ( int  iCol  )  const

Vector3 G3D::Matrix3::getRow ( int  iRow  )  const

static void G3D::Matrix3::golubKahanStep ( Matrix3 kA,
Matrix3 kL,
Matrix3 kR 
) [static, protected]

static const Matrix3& G3D::Matrix3::identity (  )  [static]

Matrix3 G3D::Matrix3::inverse ( float  fTolerance = 1e-06  )  const

bool G3D::Matrix3::inverse ( Matrix3 rkInverse,
float  fTolerance = 1e-06 
) const

bool G3D::Matrix3::isOrthonormal (  )  const

Returns true if the rows and column L2 norms are 1.0 and the rows are orthogonal.

static float G3D::Matrix3::maxCubicRoot ( float  afCoeff[3]  )  [static, protected]

static void G3D::Matrix3::mul ( const Matrix3 A,
const Matrix3 B,
Matrix3 out 
) [inline, static]

Optimized implementation of out = A * B.

It is safe (but slow) to call with A, B, and out possibly pointer equal to one another.

Matrix3 G3D::Matrix3::operator * ( float  fScalar  )  const

matrix * scalar

Vector3 G3D::Matrix3::operator * ( const Vector3 v  )  const [inline]

matrix * vector [3x3 * 3x1 = 3x1]

Matrix3 G3D::Matrix3::operator * ( const Matrix3 rkMatrix  )  const

Matrix-matrix multiply.

Matrix3& G3D::Matrix3::operator *= ( const Matrix3 rkMatrix  ) 

G3D::Matrix3::operator const float * (  )  const [inline]

G3D::Matrix3::operator float * (  )  [inline]

bool G3D::Matrix3::operator!= ( const Matrix3 rkMatrix  )  const

Matrix3 G3D::Matrix3::operator+ ( const Matrix3 rkMatrix  )  const

Matrix3& G3D::Matrix3::operator+= ( const Matrix3 rkMatrix  ) 

Matrix3 G3D::Matrix3::operator- (  )  const

Matrix3 G3D::Matrix3::operator- ( const Matrix3 rkMatrix  )  const

Matrix3& G3D::Matrix3::operator-= ( const Matrix3 rkMatrix  ) 

Matrix3& G3D::Matrix3::operator= ( const Matrix3 rkMatrix  )  [inline]

bool G3D::Matrix3::operator== ( const Matrix3 rkMatrix  )  const

const float* G3D::Matrix3::operator[] ( int  iRow  )  const [inline]

float* G3D::Matrix3::operator[] ( int  iRow  )  [inline]

member access, allows use of construct mat[r][c]

void G3D::Matrix3::orthonormalize (  ) 

Gram-Schmidt orthonormalization (applied to columns of rotation matrix).

void G3D::Matrix3::qDUDecomposition ( Matrix3 rkQ,
Vector3 rkD,
Vector3 rkU 
) const

orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12)

bool G3D::Matrix3::qLAlgorithm ( float  afDiag[3],
float  afSubDiag[3] 
) [protected]

void G3D::Matrix3::serialize ( class BinaryOutput b  )  const

void G3D::Matrix3::set ( float  fEntry00,
float  fEntry01,
float  fEntry02,
float  fEntry10,
float  fEntry11,
float  fEntry12,
float  fEntry20,
float  fEntry21,
float  fEntry22 
)

Sets all elements.

void G3D::Matrix3::setColumn ( int  iCol,
const Vector3 vector 
)

void G3D::Matrix3::setRow ( int  iRow,
const Vector3 vector 
)

void G3D::Matrix3::singularValueComposition ( const Matrix3 rkL,
const Vector3 rkS,
const Matrix3 rkR 
)

singular value decomposition

void G3D::Matrix3::singularValueDecomposition ( Matrix3 rkL,
Vector3 rkS,
Matrix3 rkR 
) const

singular value decomposition

float G3D::Matrix3::spectralNorm (  )  const

static void G3D::Matrix3::tensorProduct ( const Vector3 rkU,
const Vector3 rkV,
Matrix3 rkProduct 
) [static]

void G3D::Matrix3::toAxisAngle ( Vector3 rkAxis,
float &  rfRadians 
) const

matrix must be orthonormal

bool G3D::Matrix3::toEulerAnglesXYZ ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

The matrix must be orthonormal.

The decomposition is yaw*pitch*roll where yaw is rotation about the Up vector, pitch is rotation about the right axis, and roll is rotation about the Direction axis.

bool G3D::Matrix3::toEulerAnglesXZY ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

bool G3D::Matrix3::toEulerAnglesYXZ ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

bool G3D::Matrix3::toEulerAnglesYZX ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

bool G3D::Matrix3::toEulerAnglesZXY ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

bool G3D::Matrix3::toEulerAnglesZYX ( float &  rfYAngle,
float &  rfPAngle,
float &  rfRAngle 
) const

std::string G3D::Matrix3::toString (  )  const

Matrix3 G3D::Matrix3::transpose (  )  const

static void G3D::Matrix3::transpose ( const Matrix3 A,
Matrix3 out 
) [inline, static]

Optimized implementation of out = A.transpose().

It is safe (but slow) to call with A and out possibly pointer equal to one another.

Note that A.transpose() * v can be computed more efficiently as v * A.

void G3D::Matrix3::tridiagonal ( float  afDiag[3],
float  afSubDiag[3] 
) [protected]

static const Matrix3& G3D::Matrix3::zero (  )  [static]


Friends And Related Function Documentation

Matrix3 operator * ( int  fScalar,
const Matrix3 rkMatrix 
) [friend]

Matrix3 operator * ( float  fScalar,
const Matrix3 rkMatrix 
) [friend]

Matrix3 operator * ( double  fScalar,
const Matrix3 rkMatrix 
) [friend]

scalar * matrix

Vector3 operator * ( const Vector3 rkVector,
const Matrix3 rkMatrix 
) [friend]

vector * matrix [1x3 * 3x3 = 1x3]


Member Data Documentation

const float G3D::Matrix3::EPSILON [static]

const float G3D::Matrix3::ms_fSvdEpsilon [static, protected]

const int G3D::Matrix3::ms_iSvdMaxIterations [static, protected]


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:46 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo