My Project
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Matrix4D Class Reference

#include <geometry.h>

Public Member Functions

 Matrix4D (void)
 
 Matrix4D (const Matrix3D &m)
 
 Matrix4D (const Matrix3D &m, const Point3D &p)
 
double & operator() (int col, int row)
 
double & index (int col, int row)
 
double det (void) const
 
Matrix4D operator- (void) const
 
Matrix4D mult (const Matrix4D &m) const
 
Matrix4D operator* (const Matrix4D &m) const
 
Matrix4Doperator*= (const Matrix4D &m)
 
Matrix4D add (const Matrix4D &m) const
 
Matrix4D operator+ (const Matrix4D &m) const
 
Matrix4Doperator+= (const Matrix4D &m)
 
Matrix4D subtract (const Matrix4D &m) const
 
Matrix4D operator- (const Matrix4D &m) const
 
Matrix4Doperator-= (const Matrix4D &m)
 
Matrix4D mult (double f) const
 
Matrix4D operator* (double f) const
 
Matrix4Doperator*= (double f)
 
Matrix4D div (double f) const
 
Matrix4D operator/ (double f) const
 
Matrix4Doperator/= (double f)
 
Matrix4D transpose (void) const
 
Matrix4D invert (void) const
 
Point3D operator* (const Point3D &p) const
 
Point3D multPosition (const Point3D &position) const
 
Point3D multDirection (const Point3D &direction) const
 
Point3D multNormal (const Point3D &normal) const
 
Ray3D mult (const Ray3D &ray) const
 
Ray3D operator* (const Ray3D &ray) const
 
Point3D toEuler (void) const
 
double squareNorm (void) const
 

Static Public Member Functions

static int Invert (const Matrix4D &in, Matrix4D &out)
 
static Matrix4D IdentityMatrix (void)
 
static double SquareL2Difference (const Matrix4D &m1, const Matrix4D &m2)
 

Public Attributes

double m [4][4]
 

Detailed Description

This class represents a 4x4 matrix, used to represnt projective transformations.

Constructor & Destructor Documentation

Matrix4D::Matrix4D ( void  )

This constructor generates an identity matrix

Matrix4D::Matrix4D ( const Matrix3D m)

This constructor initializes the upper 3x3 entries of the matrix

Matrix4D::Matrix4D ( const Matrix3D m,
const Point3D p 
)

This constructor initializes the upper 3x3 entries of the matrix with the matrix and sets the last colume to the translation

Member Function Documentation

Matrix4D Matrix4D::add ( const Matrix4D m) const

This method adds two matrices and returns the sum.

double Matrix4D::det ( void  ) const

This method returns the determinant of the matrix.

Matrix4D Matrix4D::div ( double  f) const

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

Matrix4D Matrix4D::IdentityMatrix ( void  )
static

This static method returns the identity matrix.

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

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

Matrix4D Matrix4D::invert ( void  ) const

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

int Matrix4D::Invert ( const Matrix4D in,
Matrix4D 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.

Matrix4D Matrix4D::mult ( const Matrix4D m) const

This method multiplies two matrices and returns the product.

Matrix4D Matrix4D::mult ( double  f) const

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

Ray3D Matrix4D::mult ( const Ray3D ray) const

This method applies the projective transformation to a ray.

Point3D Matrix4D::multDirection ( const Point3D direction) const

This method applies the linear part of the transformation to a 3D point.

Point3D Matrix4D::multNormal ( const Point3D normal) const

This method applies the linear part of the transformatoin to a normal, (i.e. multiplying by the inverse transpose).

Point3D Matrix4D::multPosition ( const Point3D position) const

This method applies the full projective transformation to a 3D point.

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

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

Matrix4D Matrix4D::operator* ( const Matrix4D m) const

This method multiplies two matrices and returns the product.

Matrix4D Matrix4D::operator* ( double  f) const

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

Point3D Matrix4D::operator* ( const Point3D p) const

This method applies the full projective transformation to a 3D point.

Ray3D Matrix4D::operator* ( const Ray3D ray) const

This method applies the projective transformation to a ray.

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

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

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

This method scales the entries of the current matrix.

Matrix4D Matrix4D::operator+ ( const Matrix4D m) const

This method adds two matrices and returns the sum.

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

This method adds the input matrix to the current matrix.

Matrix4D Matrix4D::operator- ( void  ) const

This method returns the negative of a matrix

Matrix4D Matrix4D::operator- ( const Matrix4D m) const

This method subtracts two matrices and returns the difference.

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

This method subtracts the input matrix from the current matrix.

Matrix4D Matrix4D::operator/ ( double  f) const

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

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

This method divides the entries of the current matrix.

double Matrix4D::SquareL2Difference ( const Matrix4D m1,
const Matrix4D m2 
)
static

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

double Matrix4D::squareNorm ( void  ) const

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

Matrix4D Matrix4D::subtract ( const Matrix4D m) const

This method subtracts two matrices and returns the difference.

Point3D Matrix4D::toEuler ( void  ) const

This method returns the Euler Angles of a rotation matrix

Matrix4D Matrix4D::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 Matrix4D::m[4][4]

The actual matrix entries


The documentation for this class was generated from the following files: