Contents Functions Classes Topics User Forum CVS

G3D::Matrix3 Class Reference

#include <Matrix3.h>

List of all members.

Public Member Functions

 Matrix3 ()
 Matrix3 (class BinaryInput &b)
 Matrix3 (const float aafEntry[3][3])
 Matrix3 (const Matrix3 &rkMatrix)
 Matrix3 (float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
bool fuzzyEq (const Matrix3 &b) const
 Matrix3 (const class Quat &q)
void serialize (class BinaryOutput &b) const
void deserialize (class BinaryInput &b)
void set (float fEntry00, float fEntry01, float fEntry02, float fEntry10, float fEntry11, float fEntry12, float fEntry20, float fEntry21, float fEntry22)
float * operator[] (int iRow)
const float * operator[] (int iRow) const
 operator float * ()
 operator const float * () const
Vector3 getColumn (int iCol) const
Vector3 getRow (int iRow) const
void setColumn (int iCol, const Vector3 &vector)
void setRow (int iRow, const Vector3 &vector)
Matrix3operator= (const Matrix3 &rkMatrix)
bool operator== (const Matrix3 &rkMatrix) const
bool operator!= (const Matrix3 &rkMatrix) const
Matrix3 operator+ (const Matrix3 &rkMatrix) const
Matrix3 operator- (const Matrix3 &rkMatrix) const
Matrix3 operator * (const Matrix3 &rkMatrix) const
Matrix3 operator- () const
Matrix3operator+= (const Matrix3 &rkMatrix)
Matrix3operator-= (const Matrix3 &rkMatrix)
Matrix3operator *= (const Matrix3 &rkMatrix)
Vector3 operator * (const Vector3 &v) const
Matrix3 operator * (float fScalar) const
bool isOrthonormal () const
Matrix3 transpose () const
bool inverse (Matrix3 &rkInverse, float fTolerance=1e-06) const
Matrix3 inverse (float fTolerance=1e-06) const
float determinant () const
void singularValueDecomposition (Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
void singularValueComposition (const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
void orthonormalize ()
void qDUDecomposition (Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) 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
void eigenSolveSymmetric (float afEigenvalue[3], Vector3 akEigenvector[3]) const
std::string toString () const

Static Public Member Functions

static void mul (const Matrix3 &A, const Matrix3 &B, Matrix3 &out)
static void transpose (const Matrix3 &A, Matrix3 &out)
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 void tensorProduct (const Vector3 &rkU, const Vector3 &rkV, Matrix3 &rkProduct)
static const Matrix3zero ()
static const Matrix3identity ()

Static Public Attributes

static const float EPSILON
static const Matrix3 ZERO
static const Matrix3 IDENTITY

Protected Member Functions

void tridiagonal (float afDiag[3], float afSubDiag[3])
bool qLAlgorithm (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

Vector3 operator * (const Vector3 &rkVector, const Matrix3 &rkMatrix)
Matrix3 operator * (double fScalar, const Matrix3 &rkMatrix)
Matrix3 operator * (float fScalar, const Matrix3 &rkMatrix)
Matrix3 operator * (int fScalar, 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]
 

v * M == M.transpose() * v


Member Data Documentation

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

const Matrix3 G3D::Matrix3::IDENTITY [static]
 

Deprecated:
Use Matrix3::identity()

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

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

const Matrix3 G3D::Matrix3::ZERO [static]
 

Deprecated:
Use Matrix3::zero()


The documentation for this class was generated from the following file:
Generated on Mon Jul 17 11:50:46 2006 for G3D by doxygen 1.4.5
Hosted by SourceForge.net Logo