In file matrix.h:

class tmatrix

The tmatrix is a representation of a subset of 4x4 homogeneous transformation matrices.

Public Fields

[more]double m[16]
the tmatrix's elements, stored in row-major format
[more]static tmatrix identity
the identity tmatrix

Public Methods

[more] tmatrix(void)
constructor for an identity tmatrix
[more] tmatrix(const double d[16])
constructor for a tmatrix with the supplied elements
[more] tmatrix(const float f[16])
constructor for a tmatrix with the supplied elements
[more] tmatrix(axis a, double d)
constructor for a tmatrix representing a rotation of 'd' radians about the indicated axis.
[more] tmatrix(const quaternion &q)
constructor for a tmatrix corresponding to the rotation represented by q
[more] tmatrix(const quaternion &q, const triple &t)
constructor for a tmatrix corresponding to the rotation represented by 'q', followed by a translation of 't'
[more] tmatrix(transformation t, double x, double y, double z)
constructor for a tmatrix corresponding to either a rotation or translation.
[more] tmatrix(double rx, double ry, double rz, double xtrans, double ytrans, double ztrans)
constructor for a tmatrix equivalent to tmatrix(tmatrix::rpy, roll, pitch, yaw) multiplied by tmatrix(tmatrix::translate, xtrans, ytrans, ztrans).
[more]void set(double d[16])
sets the tmatrix's elements to the supplied values
[more]void set(float f[16])
sets the tmatrix's elements to the supplied values
[more]inline double& operator()(int r, int c)
returns a reference to the element at (r, c)
[more]inline double* operator[] (const int i)
returns a pointer to the i'th row
[more]inline operator double *(void)
returns a pointer to the tmatrix's array
[more]void getInverse(tmatrix &m)
computes the inverse of the tmatrix and stores it in m, assuming the tmatrix is composed purely of rotations and translations
[more]void invert(void)
inverts the tmatrix, assuming the tmatrix is composed purely of rotations and translations
[more]void decompose(double &rx, double &ry, double &rz, double &xtrans, double &ytrans, double &ztrans) const
decomposes a 3x3 rotation matrix into the rotation angles as specified by matrix::compose.
[more]void decompose(matrix &r, triple &t)
decomposes the tmatrix into its rotation and translation components
[more]void dump(double d[16]) const
copies the matrix to the supplied storage
[more]void dump(float f[16]) const
copies the matrix elements to the supplied storage
[more]void print(FILE* fp) const
prints the matrix to a file in a human-readable format
[more]void write(FILE* outfile) const
prints the matrix to a file in a format readable by read().
[more]int read(FILE* infile)
reads a matrix from a file in a format produced by write().
[more]void getTranspose(double d[16])
returns the transpose of the tmatrix in d.
[more]void getTranspose(float f[16])
returns the transpose of the tmatrix in d
[more]static tmatrix inverse(const tmatrix &m)
returns the inverse of m
[more]static double determinant(const tmatrix &m)
returns the determinant of m
[more]tmatrix& operator*=(const tmatrix &m2)
post-multiplies the current tmatrix by m2 (eg.
[more]tmatrix& operator=(const tmatrix &tm)
assignment operator
[more]tmatrix& operator=(const matrix &m)
assignment operator.
[more]tmatrix& operator=(const quaternion &q)
assignment operator.

Public Members

[more]enum axis
enumerated type used for indicating an axis
[more]enum transformation
enumerated type used for indicating a transformation type


Documentation

The tmatrix is a representation of a subset of 4x4 homogeneous transformation matrices. Currently, only rotation and translation transformations are supported. Scaling and skewing are not allowed because of difficulties they pose to the operations of inversion and decomposition. It is also anticipated that they will not be of tremendous utility in this application. It is possible to construct scaling and skewing matrices using the array constructors, but the invert() and decompose() functions will not work properly. This is discouraged.
odouble m[16]
the tmatrix's elements, stored in row-major format

oenum axis
enumerated type used for indicating an axis

oenum transformation
enumerated type used for indicating a transformation type

ostatic tmatrix identity
the identity tmatrix

o tmatrix(void)
constructor for an identity tmatrix

o tmatrix(const double d[16])
constructor for a tmatrix with the supplied elements

o tmatrix(const float f[16])
constructor for a tmatrix with the supplied elements

o tmatrix(axis a, double d)
constructor for a tmatrix representing a rotation of 'd' radians about the indicated axis.

o tmatrix(const quaternion &q)
constructor for a tmatrix corresponding to the rotation represented by q

o tmatrix(const quaternion &q, const triple &t)
constructor for a tmatrix corresponding to the rotation represented by 'q', followed by a translation of 't'

o tmatrix(transformation t, double x, double y, double z)
constructor for a tmatrix corresponding to either a rotation or translation. if 't' is tmatrix::rpy, a transformation tmatrix is constructed equivalent to rot(z, d1)*rot(x, d2)*rot(y, d3) where rot(u, v) specifies a rotation of v radians about the axis u. if mode is tmatrix::translate, then a translation tmatrix with tx = d1, ty = d2, and tz = d3 is constructed.

o tmatrix(double rx, double ry, double rz, double xtrans, double ytrans, double ztrans)
constructor for a tmatrix equivalent to tmatrix(tmatrix::rpy, roll, pitch, yaw) multiplied by tmatrix(tmatrix::translate, xtrans, ytrans, ztrans).

ovoid set(double d[16])
sets the tmatrix's elements to the supplied values

ovoid set(float f[16])
sets the tmatrix's elements to the supplied values

oinline double& operator()(int r, int c)
returns a reference to the element at (r, c)

oinline double* operator[] (const int i)
returns a pointer to the i'th row

oinline operator double *(void)
returns a pointer to the tmatrix's array

ovoid getInverse(tmatrix &m)
computes the inverse of the tmatrix and stores it in m, assuming the tmatrix is composed purely of rotations and translations

ovoid invert(void)
inverts the tmatrix, assuming the tmatrix is composed purely of rotations and translations

ovoid decompose(double &rx, double &ry, double &rz, double &xtrans, double &ytrans, double &ztrans) const
decomposes a 3x3 rotation matrix into the rotation angles as specified by matrix::compose. The matrix must be 3x3.

ovoid decompose(matrix &r, triple &t)
decomposes the tmatrix into its rotation and translation components

ovoid dump(double d[16]) const
copies the matrix to the supplied storage

ovoid dump(float f[16]) const
copies the matrix elements to the supplied storage

ovoid print(FILE* fp) const
prints the matrix to a file in a human-readable format

ovoid write(FILE* outfile) const
prints the matrix to a file in a format readable by read(). NOTE: some loss of precision may occur!

oint read(FILE* infile)
reads a matrix from a file in a format produced by write(). NOTE: some loss of precision may occur!

ovoid getTranspose(double d[16])
returns the transpose of the tmatrix in d.

ovoid getTranspose(float f[16])
returns the transpose of the tmatrix in d

ostatic tmatrix inverse(const tmatrix &m)
returns the inverse of m

ostatic double determinant(const tmatrix &m)
returns the determinant of m

otmatrix& operator*=(const tmatrix &m2)
post-multiplies the current tmatrix by m2 (eg. *this = (*this)*m2;)

otmatrix& operator=(const tmatrix &tm)
assignment operator

otmatrix& operator=(const matrix &m)
assignment operator. if m is 3x3, then only the rotation portion of the tmatrix is copied from m and the translation portion is set to zero. m is not checked to ensure that it represents a valid rigid-body transformation.

otmatrix& operator=(const quaternion &q)
assignment operator. sets the tmatrix's rotation component to the rotation represented by q, and sets the translation component to 0.


This class has no child classes.
Friends:
tmatrix operator*(const tmatrix &m1, const tmatrix &m2)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.