This class implements a 3D matrix. More...
#include <CMatrix3d.h>
Public Member Functions | |
cMatrix3d () | |
cMatrix3d (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) | |
cMatrix3d (const cVector3d &a_colVector0, const cVector3d &a_colVector1, const cVector3d &a_colVector2) | |
cMatrix3d (const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder, const bool a_useIntrinsicEulerModel=true, const bool a_anglesDefinedInDegrees=false) | |
cMatrix3d (const cVector3d &a_axis, const double &a_angleRad) | |
cMatrix3d (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad) | |
void | identity () |
This method builds an identity matrix. More... | |
void | set (const double &a_value) |
This method initializes all elements of this matrix with an input value. More... | |
void | set (const double a_source[3][3]) |
This method initializes this matrix from an array. More... | |
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) |
This method initializes this matrix with individual elements passed as arguments. More... | |
void | setCol (const cVector3d &a_vectCol0, const cVector3d &a_vectCol1, const cVector3d &a_vectCol2) |
This method initialize this matrix with column vectors passed as arguments. More... | |
void | setCol0 (const cVector3d &a_vectCol) |
This method initializes column 0 of this matrix. More... | |
void | setCol1 (const cVector3d &a_vectCol) |
This method initializes column 1 of this matrix. More... | |
void | setCol2 (const cVector3d &a_vectCol) |
This method initializes column 2 of this matrix. More... | |
void | get (double *a_destination[]) |
This method copies matrix elements to a table of doubles More... | |
cVector3d | getCol0 () const |
This method returns column vector 0 of matrix. More... | |
cVector3d | getCol1 () const |
This method returns column vector 1 of matrix. More... | |
cVector3d | getCol2 () const |
This method returns column vector 2 of matrix. More... | |
cVector3d | getRow (const unsigned int &a_index) const |
This method returns the i th row of matrix. More... | |
void | copyto (cMatrix3d &a_destination) const |
This method copies all elements of this matrix to another matrix. More... | |
void | copyfrom (const cMatrix3d &a_source) |
This method copies all elements from another matrix to this one. More... | |
bool | equals (cMatrix3d &a_matrix) const |
This method compares if two matrices are equal. More... | |
void | add (const cMatrix3d &a_matrix) |
This method computes the addition of this matrix with another. More... | |
void | addr (const cMatrix3d &a_matrix, cMatrix3d &a_result) const |
This method computes the addition of this matrix with another. More... | |
void | sub (const cMatrix3d &a_matrix) |
This method computes the subtraction of this matrix with another. More... | |
void | subr (const cMatrix3d &a_matrix, cMatrix3d &a_result) const |
This method computes the subtraction of this matrix with another. More... | |
void | mul (const cMatrix3d &a_matrix) |
This function computes the multiplication of this matrix with another. More... | |
void | mulr (const cMatrix3d &a_matrix, cMatrix3d &a_result) const |
This function computes the multiplication of this matrix with another. More... | |
void | mul (cVector3d &a_vector) const |
This function computes the multiplication of this matrix with a vector. More... | |
void | mulr (const cVector3d &a_vector, cVector3d &a_result) const |
This function computes the multiplication of this matrix with a vector. More... | |
double | det () const |
This method computes and returns the determinant of this matrix. More... | |
void | trans () |
This method computes the transpose of this matrix. More... | |
void | transr (cMatrix3d &a_result) const |
This method computes the transpose of this matrix. More... | |
bool | invert () |
This method computes the inverse of this matrix. More... | |
bool | invertr (cMatrix3d &a_result) const |
This method computes the inverse of this matrix. More... | |
void | orthogonalize () |
This method orthogonalizes this matrix. More... | |
bool | setAxisAngleRotationRad (const cVector3d &a_axis, const double &a_angleRad) |
This method builds a rotation matrix from an axis-angle representation. More... | |
bool | setAxisAngleRotationDeg (const cVector3d &a_axis, const double &a_angleDeg) |
This method builds a rotation matrix from an axis-angle representation. More... | |
bool | setAxisAngleRotationRad (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad) |
This method builds a rotation matrix from an axis-angle representation. More... | |
bool | setAxisAngleRotationDeg (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg) |
This method builds a rotation matrix from axis-angle representation. More... | |
void | setExtrinsicEulerRotationRad (const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder) |
This method builds a rotation matrix from an Euler angle representation. More... | |
void | setExtrinsicEulerRotationDeg (const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder) |
This method builds a rotation matrix from an Euler angle representation. More... | |
void | setIntrinsicEulerRotationRad (const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder) |
This method builds a rotation matrix from an Euler angle representation. More... | |
void | setIntrinsicEulerRotationDeg (const double &a_angle1, const double &a_angle2, const double &a_angle3, const cEulerOrder a_eulerOrder) |
This method builds a rotation matrix from an Euler angle representation. More... | |
bool | rotateAboutGlobalAxisRad (const cVector3d &a_axis, const double &a_angleRad) |
This method rotates this matrix around an axis described in global coordinates. More... | |
bool | rotateAboutGlobalAxisDeg (const cVector3d &a_axis, const double &a_angleDeg) |
This method rotates this matrix around an axis described in global coordinates. More... | |
bool | rotateAboutGlobalAxisRad (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad) |
This method rotates this matrix around an axis described in global coordinates. More... | |
bool | rotateAboutGlobalAxisDeg (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg) |
This method rotates this matrix around an axis described in global coordinates. More... | |
bool | rotateAboutLocalAxisRad (const cVector3d &a_axis, const double &a_angleRad) |
This method rotates this matrix around an axis described in local coordinates. More... | |
bool | rotateAboutLocalAxisDeg (const cVector3d &a_axis, const double &a_angleDeg) |
This method rotates this matrix around an axis described in local coordinates. More... | |
bool | rotateAboutLocalAxisRad (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad) |
This method rotates this matrix around an axis described in local coordinates. More... | |
bool | rotateAboutLocalAxisDeg (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg) |
This method rotates this matrix around an axis described in local coordinates. More... | |
bool | toAxisAngle (cVector3d &a_axis, double &a_angle) const |
This method converts this rotation matrix to an axis-angle representation. More... | |
std::string | str (const unsigned int a_precision=2) const |
This method converts this matrix to a string representation. More... | |
void | operator*= (const double &a_val) |
An overloaded *= operator for matrix/scalar multiplication. More... | |
cVector3d | operator* (const cVector3d &a_val) |
An overloaded * operator for matrix/vector multiplication. More... | |
cMatrix3d | operator* (const cMatrix3d &a_val) |
An overloaded * operator for matrix/matrix multiplication. More... | |
void | operator*= (const cMatrix3d &a_val) |
An overloaded *= operator for matrix/matrix multiplication. More... | |
void | operator+= (const cMatrix3d &a_input) |
An overloaded += operator for matrix/matrix addition. More... | |
void | operator-= (const cMatrix3d &a_input) |
An overloaded -= operator for matrix/matrix subtraction. More... | |
double & | operator() (const int a_index0, const int a_index1) |
An overloaded () operator. More... | |
const double & | operator() (const int a_index0, const int a_index1) const |
An overloaded () operator. More... | |
This matrix class provides storage for a 3x3 double precision floating point matrix as well as basic matrix and vector operations.
|
inline |
Constructor of cMatrix3d.
|
inline |
Constructor of cMatrix3d.
Initializes matrix by passing as arguments 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) |
|
inline |
Constructor of cMatrix3d.
Initializes matrix from a set of column vectors passed as arguments.
a_colVector0 | Column vector 0. |
a_colVector1 | Column vector 1. |
a_colVector2 | Column vector 2. |
|
inline |
Constructor of cMatrix3d.
Builds a rotation matrix from a set of Euler angles and co-moving axes of rotations.
a_angle1 | Angle of the first rotation in the sequence. |
a_angle2 | Angle of the second rotation in the sequence. |
a_angle3 | Angle of the third rotation in the sequence. |
a_eulerOrder | The order of the axes about which the rotations are to be applied |
a_useIntrinsicEulerModel | If true use intrinsic Euler model, if false use extrinsic Euler model. |
a_anglesDefinedInDegrees | If true then the angles passed by argument are defined in degrees, if false then the angles are defined in radians. |
|
inline |
Constructor of cMatrix3d.
Builds a rotation matrix from an axis-angle representation passed as argument.
a_axis | Axis vector. |
a_angleRad | Angle in radians. |
|
inline |
Constructor of cMatrix3d.
Builds a rotation matrix from an axis-angle representation.
a_axisX | x component of axis. |
a_axisY | y component of axis. |
a_axisZ | z component of axis. |
a_angleRad | Angle in radian. |
|
inline |
This method builds an identity matrix with ones on the main diagonal and zeros elsewhere.
|
inline |
This method initializes all elements of this matrix with an input scalar value a_value
passed as argument.
a_value | Value. |
|
inline |
This method initializes this matrix from a table of doubles passed as argument.
a_source | Table of doubles. |
|
inline |
This method initialize this matrix by passing as argument 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) |
|
inline |
This method initialize this matrix with column vectors passed as arguments a_vectCol0
, a_vectCol1
, and a_vectCol2
.
a_vectCol0 | Vector Column 0. |
a_vectCol1 | Vector Column 1. |
a_vectCol2 | Vector Column 2. |
|
inline |
This method sets column 0 of this matrix by passing an input vector a_vectCol
passed as argument.
a_vectCol | Vector Column 0. |
|
inline |
This method sets column 1 of this matrix by passing an input vector a_vectCol
passed as argument.
a_vectCol | Vector Column 1. |
|
inline |
This method sets column 2 of this matrix by passing an input vector a_vectCol
passed as argument.
a_vectCol | Vector Column 2. |
|
inline |
This method copies matrix elements to a table a_destination
of doubles passed as argument.
a_destination | Table of doubles. |
|
inline |
This method returns column vector 0 of matrix.
|
inline |
This method returns column vector 1 of matrix.
|
inline |
This method returns column vector 2 of matrix.
|
inline |
This method returns the i th of matrix. The three components are returned through a cVector3d data structure.
a_index | Index of row. (0,1 or 2) |
|
inline |
This method copies all elements of this matrix to another matrix a_destination
passed as argument.
a_destination | Destination matrix. |
|
inline |
This method copies all elements of a matrix a_source
passed as argument to this one.
a_source | Source matrix. |
|
inline |
This methods compare two matrices and returns true if both matrices are equal, otherwise false.
a_matrix | Matrix to compare with. |
|
inline |
This method computes the addition of this matrix with a matrix passed as argument.
The result is stored in this matrix.
a_matrix | Input matrix. |
This method computes the addition of this matrix with a matrix passed as argument.
The result is stored is the result matrix a_result
that is passed as argument.
a_matrix | Input matrix. |
a_result | Result of operation. |
|
inline |
This method computes the subtraction of this matrix with a matrix passed as argument.
The result is stored in this matrix.
a_matrix | Input matrix. |
This method computes the subtraction of this matrix with a matrix passed as argument.
The result is stored is the result matrix a_result
that is passed as argument.
a_matrix | Input matrix. |
a_result | Result of operation. |
|
inline |
This function computes the multiplication of this matrix with a matrix a_matrix
passed as argument.
The result of this operation is stored in this matrix overwriting previous values.
a_matrix | Input matrix. |
This function computes the multiplication of this matrix with a matrix a_matrix
passed as argument.
The result of this operation is stored in the result matrix a_result
passed as argument.
a_matrix | Input matrix. |
a_result | Result of operation. |
|
inline |
This function computes the multiplication of this matrix with a vector a_vector
passed as argument.
The result of this operation is stored in the same vector a_vector
overwriting previous values.
a_vector | Input vector and return result. |
This function computes the multiplication of this matrix with a vector a_vector
passed as argument.
The result of this operation is stored in the result vector a_result
passed as second argument.
a_vector | Input vector |
a_result | Result of operation. |
|
inline |
This method computes and returns the determinant of this matrix.
|
inline |
This method computes the transpose of this matrix.
The result of this operation is stored in this matrix overwriting previous values.
|
inline |
This method computes the transpose of this matrix.
The result of this operation is stored in the result matrix a_result
matrix passed as argument.
a_result | Output matrix. |
|
inline |
This method computes the inverse of this matrix.
If the operation succeeds, the result is stored in this matrix.
|
inline |
This method computes the inverse of this matrix.
If the operation succeeds, the result is stored in the result matrix a_result
passed as argument.
|
inline |
This method orthogonalizes this matrix so that all columns vectors are orthogonal to each other and of length 1. This method is useful if your rotation matrix has accumulated small error.
|
inline |
this method builds a rotation matrix from an input axis and angle defined in radians.
The result is stored in this matrix overwriting previous values.
a_axis | Axis of rotation. |
a_angleRad | Angle in radians. |
|
inline |
This method builds a rotation matrix from an input axis and angle defined in degrees.
The result is stored in this matrix overwriting previous values.
a_axis | Axis of rotation. |
a_angleDeg | Angle in degrees. |
|
inline |
This method builds a rotation matrix from an input axis and angle defined in radians.
The result is stored in this matrix overwriting previous values.
a_axisX | Component x of axis. |
a_axisY | Component y of axis. |
a_axisZ | Component z of axis. |
a_angleRad | Angle in radians. |
|
inline |
This method builds a rotation matrix from an axis and angle defined in degrees.
The result is stored in this matrix overwriting previous values.
a_axisX | Component x of axis. |
a_axisY | Component y of axis. |
a_axisZ | Component z of axis. |
a_angleDeg | Angle in degrees. |
|
inline |
This method builds a rotation matrix from a set of Euler angles and fixed axes of rotations.
a_angle1 | Angle in radians of the first rotation in the sequence. |
a_angle2 | Angle in radians of the second rotation in the sequence. |
a_angle3 | Angle in radians of the third rotation in the sequence. |
a_eulerOrder | The order of the axes about which the rotations are to be applied. |
|
inline |
This method builds a rotation matrix from a set of Euler angles and fixed axes of rotations.
a_angle1 | Angle in degrees of the first rotation in the sequence. |
a_angle2 | Angle in degrees of the second rotation in the sequence. |
a_angle3 | Angle in degrees of the third rotation in the sequence. |
a_eulerOrder | The order of the axes about which the rotations are to be applied. |
|
inline |
This method builds a rotation matrix from a set of Euler angles and co-moving axes of rotations.
a_angle1 | Angle in radians of the first rotation in the sequence. |
a_angle2 | Angle in radians of the second rotation in the sequence. |
a_angle3 | Angle in radians of the third rotation in the sequence. |
a_eulerOrder | The order of the axes about which the rotations are to be applied. |
|
inline |
This method builds a rotation matrix from a set of Euler angles and co-moving axes of rotations.
a_angle1 | Angle in degrees of the first rotation in the sequence. |
a_angle2 | Angle in degrees of the second rotation in the sequence. |
a_angle3 | Angle in degrees of the third rotation in the sequence. |
a_eulerOrder | The order of the axes about which the rotations are to be applied. |
|
inline |
This method rotates this matrix around an axis described in global coordinates.
a_axis | Axis of rotation. |
a_angleRad | Angle in radians. |
|
inline |
This method rotates this matrix around an axis described in global coordinates.
a_axis | Axis of rotation. |
a_angleDeg | Angle in degrees. |
|
inline |
This method rotates this matrix around an axis described in global coordinates.
a_axisX | x component of axis. |
a_axisY | y component of axis. |
a_axisZ | z component of axis. |
a_angleRad | Angle in radians. |
|
inline |
This method rotates current matrix around an axis described in global coordinates.
a_axisX | x component of axis. |
a_axisY | y component of axis. |
a_axisZ | z component of axis. |
a_angleDeg | Angle in degrees. |
|
inline |
This method rotates this current matrix around an axis described in local coordinates.
a_axis | Axis of rotation. |
a_angleRad | Angle in radians. |
|
inline |
This method rotates this matrix around an axis described in local coordinates.
a_axis | Axis of rotation. |
a_angleDeg | Angle in degrees. |
|
inline |
This method rotates this matrix around an axis described in local coordinates.
a_axisX | x component of axis. |
a_axisY | y component of axis. |
a_axisZ | z component of axis. |
a_angleRad | Angle in radians. |
|
inline |
This method rotates this matrix around an axis described in local coordinates.
a_axisX | x component of axis. |
a_axisY | y component of axis. |
a_axisZ | z component of axis. |
a_angleDeg | Angle in degrees. |
|
inline |
This method converts this rotation matrix to an axis-angle representation.
a_axis | Output axis. |
a_angle | Output angle. |
|
inline |
This method converts this matrix to a string representation. The output springs displays the three column vectors of matrix.
The number of digits after the decimal point are set by argument a_precision
.
a_precision | Number of digits. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |