#include <matrix.h>
Public Member Functions | |
Matrix () | |
Default constructor. The matrix is initialized to identity. | |
Matrix (float s) | |
Constructor initializing all elements to the given value. | |
virtual | ~Matrix () |
Destructor. Does nothing. | |
Matrix & | operator= (float s) |
Assignment from a scalar value. | |
float | operator() (int i, int j) const |
Returns a copy of the element at position row,column (i,j). | |
float & | operator() (int i, int j) |
Returns a reference to the element at position row,column (i,j). | |
Matrix & | zero () |
Clear all elements to zero. | |
Matrix & | identity () |
Set matrix to identity. | |
Matrix & | scale (float sx, float sy, float sz) |
Setup scaling matrix. | |
Matrix & | translation (float tx, float ty, float tz) |
Setup translation matrix. | |
Matrix & | rotX (float rx) |
Setup rotation matrix around the x-axis, where the rotation angle is given in degrees. | |
Matrix & | rotY (float ry) |
Setup rotation matrix around the y-axis, where the rotation angle is given in degrees. | |
Matrix & | rotZ (float rz) |
Setup rotation matrix around the z-axis, where the rotation angle is given in degrees. | |
Matrix | operator+ (const Matrix &m) const |
Addition of two matrices. | |
Matrix & | operator+= (const Matrix &m) |
Addition of two matrices in place. | |
Matrix | operator- (const Matrix &m) const |
Subtraction of two matrices. | |
Matrix & | operator-= (const Matrix &m) |
Subtraction of two matrices in place. | |
Matrix | operator * (float s) const |
Multiplication of matrix by scalar. | |
Matrix & | operator *= (float s) |
Multiplication by scalar in place. | |
Point | operator * (const Point &p) const |
Matrix/point multiplication. The point is translated by the last column. | |
Vector | operator * (const Vector &v) const |
Matrix/vector multiplication. The vector is not translated by the last column. | |
Matrix | operator * (const Matrix &m) const |
Matrix multiplication. | |
Matrix & | operator *= (const Matrix &m) |
Matrix multiplication in place. | |
float | determinant () const |
Compute the determinant of the matrix. | |
Matrix | inverse () const |
Compute the inverse of the matrix. | |
Protected Attributes | |
float | e [16] |
The matrix elements. | |
Friends | |
Matrix | operator * (float s, const Matrix &m) |
Multiplication of sclar by matrix. | |
std::ostream & | operator<< (std::ostream &os, const Matrix &A) |
Write matrix elements to an output stream. |