#include <CMatrix3d.h>
Public Member Functions | |
cMatrix3d () | |
void | set (const double &a_value) |
void | set (const double &a_m00, const double &a_m01, const double &a_m02, const double &a_m10, const double &a_m11, const double &a_m12, const double &a_m20, const double &a_m21, const double &a_m22) |
void | setCol (const cVector3d &a_vectCol0, const cVector3d &a_vectCol1, const cVector3d &a_vectCol2) |
void | setCol0 (const cVector3d &a_vectCol) |
void | setCol1 (const cVector3d &a_vectCol) |
void | setCol2 (const cVector3d &a_vectCol) |
cVector3d | getCol0 () const |
cVector3d | getCol1 () const |
cVector3d | getCol2 () const |
cVector3d | getRow (const unsigned int &index) const |
cVector3d | operator[] (const unsigned int &index) const |
void | operator/= (const double &a_val) |
void | operator*= (const double &a_val) |
cVector3d | operator* (const cVector3d &a_val) |
cMatrix3d | operator* (const cMatrix3d &a_val) |
void | operator*= (const cMatrix3d &a_val) |
void | operator+= (const cMatrix3d &a_input) |
void | operator-= (const cMatrix3d &a_input) |
void | copyto (cMatrix3d &a_destination) const |
void | copyfrom (const cMatrix3d &a_source) |
void | identity () |
void | mul (const cMatrix3d &a_matrix) |
void | mulr (const cMatrix3d &a_matrix, cMatrix3d &a_result) const |
void | mul (cVector3d &a_vector) const |
void | mulr (const cVector3d &a_vector, cVector3d &a_result) const |
double | det () const |
void | trans () |
void | transr (cMatrix3d &a_result) const |
bool | invert () |
cMatrix3d | inv (bool *a_result=0) const |
bool | invertr (cMatrix3d &a_result) const |
bool | set (const cVector3d &a_axis, const double &a_angleRad) |
bool | rotate (const cVector3d &a_axis, const double &a_angleRad) |
bool | rotater (const cVector3d &a_axis, const double &a_angleRad, cMatrix3d &a_result) const |
void | str (string &a_string, const unsigned int a_precision=2) const |
string | str (const unsigned int a_precision=2) const |
void | print (const unsigned int a_precision=2) const |
bool | equals (cMatrix3d &a_matrix) const |
bool | toAngleAxis (double &a_angle, cVector3d &a_axis) |
Public Attributes | |
double | m [3][3] |
Array of doubles describing the matrix. |
cMatrix3d::cMatrix3d | ( | ) | [inline] |
Constructor of cMatrix3d.
void cMatrix3d::copyfrom | ( | const cMatrix3d & | a_source | ) | [inline] |
Copy values from an external matrix passed as parameter to current matrix.
a_source | Source matrix. |
void cMatrix3d::copyto | ( | cMatrix3d & | a_destination | ) | const [inline] |
Copy current matrix values to an external matrix passed as parameter.
a_destination | Destination matrix. |
double cMatrix3d::det | ( | ) | const [inline] |
Compute the determinant of current matrix.
bool cMatrix3d::equals | ( | cMatrix3d & | a_matrix | ) | const [inline] |
Compare two matrices. Return true if both matrices are equal, otherwise return false.
a_matrix | Matrix to compare with. |
cVector3d cMatrix3d::getCol0 | ( | ) | const [inline] |
Read column vector 0 of matrix.
cVector3d cMatrix3d::getCol1 | ( | ) | const [inline] |
Read column vector 1 of matrix.
cVector3d cMatrix3d::getCol2 | ( | ) | const [inline] |
Read column vector 2 of matrix.
cVector3d cMatrix3d::getRow | ( | const unsigned int & | index | ) | const [inline] |
Read a row of this matrix.
void cMatrix3d::identity | ( | ) | [inline] |
Set the identity matrix.
cMatrix3d cMatrix3d::inv | ( | bool * | a_result = 0 |
) | const [inline] |
Compute the inverse of current matrix.
If the operation succeeds, result is returned.
a_result | (optional) return true if the operation succeeds otherwise false. |
bool cMatrix3d::invert | ( | ) | [inline] |
Compute the inverse of current matrix.
If the operation succeeds, result is stored in current matrix.
bool cMatrix3d::invertr | ( | cMatrix3d & | a_result | ) | const [inline] |
Compute the inverse of current matrix. If the operation succeeds, result is stored in result matrix passed as parameter.
a_result | Result is stored here. |
void cMatrix3d::mul | ( | cVector3d & | a_vector | ) | const [inline] |
Multiply current matrix with an external vector passed as parameter.
vector = M * vector.
Result is stored in same vector.
a_vector | Vector with which multiplication is performed. Result is stored is same vector. |
void cMatrix3d::mul | ( | const cMatrix3d & | a_matrix | ) | [inline] |
Multiply current matrix with an external matrix. M = M * a_matrix. Result is stored in current matrix.
a_matrix | Matrix with which multiplication is performed. |
Multiply current matrix with a vector.
result = M * vector.
Result is stored in result vector result. `
a_vector | Vector with which multiplication is performed. | |
a_result | Result of multiplication is stored here. |
Multiply current matrix with an external matrix.
result = M * matrix.
Result is stored in result matrix.
a_matrix | Matrix with which multiplication is performed. | |
a_result | Result matrix. |
An overloaded * operator for matrix/matrix multiplication.
An overloaded * operator for matrix/vector multiplication.
void cMatrix3d::operator*= | ( | const cMatrix3d & | a_val | ) | [inline] |
An overloaded *= operator for matrix/matrix multiplication.
void cMatrix3d::operator*= | ( | const double & | a_val | ) | [inline] |
An overloaded *= operator for matrix/scalar multiplication.
void cMatrix3d::operator+= | ( | const cMatrix3d & | a_input | ) | [inline] |
An overloaded += operator for matrix/matrix addition.
void cMatrix3d::operator-= | ( | const cMatrix3d & | a_input | ) | [inline] |
An overloaded -= operator for matrix/matrix subtraction.
void cMatrix3d::operator/= | ( | const double & | a_val | ) | [inline] |
An overloaded /= operator for matrix/scalar division.
cVector3d cMatrix3d::operator[] | ( | const unsigned int & | index | ) | const [inline] |
This is a slightly confusing operator, because the operation:
my_matrix[1][2] = 4.0;
Warning:
...compiles, but does not modify the matrix. Be careful!
void cMatrix3d::print | ( | const unsigned int | a_precision = 2 |
) | const [inline] |
Print the current matrix using the CHAI_DEBUG_PRINT macro.
a_precision | Number of digits. |
bool cMatrix3d::rotate | ( | const cVector3d & | a_axis, | |
const double & | a_angleRad | |||
) | [inline] |
Rotate current matrix around an axis an angle defined as parameters.
a_axis | Axis of rotation. | |
a_angleRad | Rotation angle in Radian. |
bool cMatrix3d::rotater | ( | const cVector3d & | a_axis, | |
const double & | a_angleRad, | |||
cMatrix3d & | a_result | |||
) | const [inline] |
Rotate current matrix around an axis an angle defined as parameters.
Result is stored in result matrix.
a_axis | Axis of rotation. | |
a_angleRad | Rotation angle in Radian. | |
a_result | Result is stored here. |
bool cMatrix3d::set | ( | const cVector3d & | a_axis, | |
const double & | a_angleRad | |||
) | [inline] |
Build a rotation matrix defined by a rotation axis and rotation angle given in radian. These values are passed as parameters.
Result is stored in current matrix.
a_axis | Axis of rotation. | |
a_angleRad | Rotation angle in Radian. |
void cMatrix3d::set | ( | const double & | a_m00, | |
const double & | a_m01, | |||
const double & | a_m02, | |||
const double & | a_m10, | |||
const double & | a_m11, | |||
const double & | a_m12, | |||
const double & | a_m20, | |||
const double & | a_m21, | |||
const double & | a_m22 | |||
) | [inline] |
Initialize a matrix bypassing as parameter values for each cell.
a_m00 | Matrix Component [0,0] | |
a_m01 | Matrix Component [0,1] | |
a_m02 | Matrix Component [0,2] | |
a_m10 | Matrix Component [1,0] | |
a_m11 | Matrix Component [1,1] | |
a_m12 | Matrix Component [1,2] | |
a_m20 | Matrix Component [2,0] | |
a_m21 | Matrix Component [2,1] | |
a_m22 | Matrix Component [2,2] |
void cMatrix3d::set | ( | const double & | a_value | ) | [inline] |
Initialize a matrix with a scalar which is copied to each cell of the matrix.
a_value | Value. |
void cMatrix3d::setCol | ( | const cVector3d & | a_vectCol0, | |
const cVector3d & | a_vectCol1, | |||
const cVector3d & | a_vectCol2 | |||
) | [inline] |
Initialize a matrix by passing as parameter 3 column vectors.
M = (V0,V1,V2).
a_vectCol0 | Vector Column 0. | |
a_vectCol1 | Vector Column 1. | |
a_vectCol2 | Vector Column 2. |
void cMatrix3d::setCol0 | ( | const cVector3d & | a_vectCol | ) | [inline] |
Set column 0 of matrix with vector passed as parameter.
a_vectCol | Vector Column 0. |
void cMatrix3d::setCol1 | ( | const cVector3d & | a_vectCol | ) | [inline] |
Set column 1 of matrix with vector passed as parameter.
a_vectCol | Vector Column 1. |
void cMatrix3d::setCol2 | ( | const cVector3d & | a_vectCol | ) | [inline] |
Set column 2 of matrix with vector passed as parameter.
a_vectCol | Vector Column 2. |
string cMatrix3d::str | ( | const unsigned int | a_precision = 2 |
) | const [inline] |
Convert current matrix into a string, which is returned on the stack.
a_precision | Number of digits. |
void cMatrix3d::str | ( | string & | a_string, | |
const unsigned int | a_precision = 2 | |||
) | const [inline] |
Convert current matrix into a string.
a_string | String where conversion is stored | |
a_precision | Number of digits. |
bool cMatrix3d::toAngleAxis | ( | double & | a_angle, | |
cVector3d & | a_axis | |||
) | [inline] |
Convert the rotation to an angle axis
a_angle | Angle result | |
a_axis | Axis result |
void cMatrix3d::trans | ( | ) | [inline] |
Compute the transpose of current matrix.
Result is stored in current matrix.
void cMatrix3d::transr | ( | cMatrix3d & | a_result | ) | const [inline] |
Compute the transpose of current matrix.
Result is stored in result matrix.
a_result | Result is stored here. |