My Project
Matrix3D Class Reference

`#include <geometry.h>`

## Public Member Functions

Matrix3D (void)

Matrix3D (const Point3D &eulerAngles)

Matrix3D (const class Quaternion &q)

Matrix3D (const class Matrix4D &m)

double & operator() (int col, int row)

double & index (int col, int row)

double det (void) const

Matrix3D operator- (void) const

Matrix3D operator* (const Matrix3D &m) const

Matrix3Doperator*= (const Matrix3D &m)

Matrix3D operator+ (const Matrix3D &m) const

Matrix3Doperator+= (const Matrix3D &m)

Matrix3D operator- (const Matrix3D &m) const

Matrix3Doperator-= (const Matrix3D &m)

Matrix3D operator* (double f) const

Matrix3Doperator*= (double f)

Matrix3D operator/ (double f) const

Matrix3Doperator/= (double f)

Matrix3D transpose (void) const

Matrix3D invert (void) const

Point3D operator* (const Point3D &p) const

Ray3D operator* (const Ray3D &ray) const

Point3D toEuler (void) const

Point3D toEuler (const Point3D &euler) const

double squareNorm (void) const

void SVD (Matrix3D &r1, Matrix3D &diagonal, Matrix3D &r2) const

void Factor (Matrix3D &rot, Matrix3D &sym) const

Matrix3D closestRotation (void) const

Matrix3D symmetrize (void) const

Matrix3D skewSymmetrize (void) const

## Static Public Member Functions

static int Invert (const Matrix3D &in, Matrix3D &out)

static Matrix3D IdentityMatrix (void)

static double SquareL2Difference (const Matrix3D &m1, const Matrix3D &m2)

static Matrix3D Exp (const Matrix3D &m, int iter=100)

static Matrix3D Log (const Matrix3D &m, double eps=0.0001)

static Matrix3D SquareRoot (const Matrix3D &m, double eps=0.000001)

double m [3][3]

## Detailed Description

This class represents a 3x3 matrix.

## Constructor & Destructor Documentation

 Matrix3D::Matrix3D ( void )

This constructor generates an identity matrix

 Matrix3D::Matrix3D ( const Point3D & eulerAngles )

This constructor generates a rotation matrix from the specified Euler angles

 Matrix3D::Matrix3D ( const class Quaternion & q )

This constructor generates a rotation matrix from the specified quaternion

 Matrix3D::Matrix3D ( const class Matrix4D & m )

This constructor generates a matrix from the top 3x3 matrix of the Matrix4D

## Member Function Documentation

 Matrix3D Matrix3D::closestRotation ( void ) const

This method returns the closest 3x3 rotation matrix

 double Matrix3D::det ( void ) const

This method returns the determinant of the matrix.

 Matrix3D Matrix3D::Exp ( const Matrix3D & m, int iter = `100` )
static

This method returns the exponent of a matrix

 void Matrix3D::Factor ( Matrix3D & rot, Matrix3D & sym ) const

This method factors a matrix as the product of a rotation and a symmetric matrix

 Matrix3D Matrix3D::IdentityMatrix ( void )
static

This static method returns the identity matrix.

 double & Matrix3D::index ( int col, int row )

This method returns the entry of the matrix in the col-th column and the row-th row.

 Matrix3D Matrix3D::invert ( void ) const

This method returns the inverse of a matrix. (Note that it does not change the entries of the current matrix.)

 int Matrix3D::Invert ( const Matrix3D & in, Matrix3D & out )
static

This static method tries to invert the input matrix and write it out into the output. A value of 0 is returned if the matrix has 0 determinant.

 Matrix3D Matrix3D::Log ( const Matrix3D & m, double eps = `0.0001` )
static

This method returns the logarithm of a matrix

 double & Matrix3D::operator() ( int col, int row )

This method returns the entry of the matrix in the col-th column and the row-th row.

 Matrix3D Matrix3D::operator* ( const Matrix3D & m ) const

This method multiplies two matrices and returns the product.

 Matrix3D Matrix3D::operator* ( double f ) const

This method scales the entries of a matrix and returns a new matrix.

 Point3D Matrix3D::operator* ( const Point3D & p ) const

This method transforms a 3D point.

 Ray3D Matrix3D::operator* ( const Ray3D & ray ) const

This method applies transformation to a ray.

 Matrix3D & Matrix3D::operator*= ( const Matrix3D & m )

This method multiplies the current matrix (on the right) by the input matrix..

 Matrix3D & Matrix3D::operator*= ( double f )

This method scales the entries of the current matrix.

 Matrix3D Matrix3D::operator+ ( const Matrix3D & m ) const

This method adds two matrices and returns the sum.

 Matrix3D & Matrix3D::operator+= ( const Matrix3D & m )

This method adds the input matrix to the current matrix.

 Matrix3D Matrix3D::operator- ( void ) const

This method returns the negative of the matrix

 Matrix3D Matrix3D::operator- ( const Matrix3D & m ) const

This method subtracts two matrices and returns the difference.

 Matrix3D & Matrix3D::operator-= ( const Matrix3D & m )

This method subtracts the input matrix from the current matrix.

 Matrix3D Matrix3D::operator/ ( double f ) const

This method divides the entries of a matrix and returns a new matrix.

 Matrix3D & Matrix3D::operator/= ( double f )

This method divides the entries of the current matrix.

 Matrix3D Matrix3D::skewSymmetrize ( void ) const

This method returns nearest skew-symmetric matrix

 double Matrix3D::SquareL2Difference ( const Matrix3D & m1, const Matrix3D & m2 )
static

This method returns sum of the squares of the entries of the difference matrix.

 double Matrix3D::squareNorm ( void ) const

This method returns the sum of the squares of the matrix entries

 Matrix3D Matrix3D::SquareRoot ( const Matrix3D & m, double eps = `0.000001` )
static

This method returns the square-root of a matrix

 void Matrix3D::SVD ( Matrix3D & r1, Matrix3D & diagonal, Matrix3D & r2 ) const

This method computes the SVD decomposition of the upper 3x3 matrix, such that r1 and r2 are rotations and the upper 3x3 matrix is equal to r1*diagonal*r2

 Matrix3D Matrix3D::symmetrize ( void ) const

This method returns nearest symmetric matrix

 Point3D Matrix3D::toEuler ( void ) const

This method returns the Euler Angles of a rotation matrix

 Point3D Matrix3D::toEuler ( const Point3D & euler ) const

Because the Euler angles are not unique, the following method returns the Euler angles closest to the input ones

 Matrix3D Matrix3D::transpose ( void ) const

This method returns the transpose of a matrix. (Note that it does not change the entries of the current matrix.)

## Member Data Documentation

 double Matrix3D::m[3][3]

The actual matrix entries

The documentation for this class was generated from the following files:
• Util/geometry.h
• Util/geometry.cpp
• Util/geometry.todo.cpp