In file matrix.h: The tmatrix is a representation of a subset of 4x4 homogeneous transformation matrices.
Public Fields
-
double m[16]
- the tmatrix's elements, stored in row-major format
-
static tmatrix identity
- the identity tmatrix
Public Methods
-
tmatrix(void)
- constructor for an identity tmatrix
-
tmatrix(const double d[16])
- constructor for a tmatrix with the supplied elements
-
tmatrix(const float f[16])
- constructor for a tmatrix with the supplied elements
-
tmatrix(axis a, double d)
- constructor for a tmatrix representing a rotation of 'd' radians about the indicated axis.
-
tmatrix(const quaternion &q)
- constructor for a tmatrix corresponding to the rotation represented by q
-
tmatrix(const quaternion &q, const triple &t)
- constructor for a tmatrix corresponding to the rotation represented by 'q', followed by a translation of 't'
-
tmatrix(transformation t, double x, double y, double z)
- constructor for a tmatrix corresponding to either a rotation or translation.
-
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).
-
void set(double d[16])
- sets the tmatrix's elements to the supplied values
-
void set(float f[16])
- sets the tmatrix's elements to the supplied values
-
inline double& operator()(int r, int c)
- returns a reference to the element at (r, c)
-
inline double* operator[] (const int i)
- returns a pointer to the i'th row
-
inline operator double *(void)
- returns a pointer to the tmatrix's array
-
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
-
void invert(void)
- inverts the tmatrix, assuming the tmatrix is composed purely of rotations and translations
-
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.
-
void decompose(matrix &r, triple &t)
- decomposes the tmatrix into its rotation and translation components
-
void dump(double d[16]) const
- copies the matrix to the supplied storage
-
void dump(float f[16]) const
- copies the matrix elements to the supplied storage
-
void print(FILE* fp) const
- prints the matrix to a file in a human-readable format
-
void write(FILE* outfile) const
- prints the matrix to a file in a format readable by read().
-
int read(FILE* infile)
- reads a matrix from a file in a format produced by write().
-
void getTranspose(double d[16])
- returns the transpose of the tmatrix in d.
-
void getTranspose(float f[16])
- returns the transpose of the tmatrix in d
-
static tmatrix inverse(const tmatrix &m)
- returns the inverse of m
-
static double determinant(const tmatrix &m)
- returns the determinant of m
-
tmatrix& operator*=(const tmatrix &m2)
- post-multiplies the current tmatrix by m2 (eg.
-
tmatrix& operator=(const tmatrix &tm)
- assignment operator
-
tmatrix& operator=(const matrix &m)
- assignment operator.
-
tmatrix& operator=(const quaternion &q)
- assignment operator.
Public Members
-
enum axis
- enumerated type used for indicating an axis
-
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.
- double m[16]
- the tmatrix's elements, stored in row-major format
- enum axis
- enumerated type used for indicating an axis
- enum transformation
- enumerated type used for indicating a transformation type
- static tmatrix identity
- the identity tmatrix
- tmatrix(void)
- constructor for an identity tmatrix
- tmatrix(const double d[16])
- constructor for a tmatrix with the supplied elements
- tmatrix(const float f[16])
- constructor for a tmatrix with the supplied elements
- tmatrix(axis a, double d)
- constructor for a tmatrix representing a rotation of 'd' radians about
the indicated axis.
- tmatrix(const quaternion &q)
- constructor for a tmatrix corresponding to the rotation represented by
q
- tmatrix(const quaternion &q, const triple &t)
- constructor for a tmatrix corresponding to the rotation represented by
'q', followed by a translation of 't'
- 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.
- 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).
- void set(double d[16])
- sets the tmatrix's elements to the supplied values
- void set(float f[16])
- sets the tmatrix's elements to the supplied values
- inline double& operator()(int r, int c)
- returns a reference to the element at (r, c)
- inline double* operator[] (const int i)
- returns a pointer to the i'th row
- inline operator double *(void)
- returns a pointer to the tmatrix's array
- 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
- void invert(void)
- inverts the tmatrix, assuming the tmatrix is composed purely of
rotations and translations
- 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. The matrix must be 3x3.
- void decompose(matrix &r, triple &t)
- decomposes the tmatrix into its rotation and translation components
- void dump(double d[16]) const
- copies the matrix to the supplied storage
- void dump(float f[16]) const
- copies the matrix elements to the supplied storage
- void print(FILE* fp) const
- prints the matrix to a file in a human-readable format
- void write(FILE* outfile) const
- prints the matrix to a file in a format readable by read(). NOTE:
some loss of precision may occur!
- int read(FILE* infile)
- reads a matrix from a file in a format produced by write(). NOTE:
some loss of precision may occur!
- void getTranspose(double d[16])
- returns the transpose of the tmatrix in d.
- void getTranspose(float f[16])
- returns the transpose of the tmatrix in d
- static tmatrix inverse(const tmatrix &m)
- returns the inverse of m
- static double determinant(const tmatrix &m)
- returns the determinant of m
- tmatrix& operator*=(const tmatrix &m2)
- post-multiplies the current tmatrix by m2 (eg. *this = (*this)*m2;)
- tmatrix& operator=(const tmatrix &tm)
- assignment operator
- tmatrix& 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.
- tmatrix& 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++.