![]() |
Efficient, generic implementation of a 3x3 rotation matrix.The RotationMatrix class is the representation of a 3x3 rotation matrix with a total of 9 statically allocated elements of arbitrary type. The naming convention of the elements is as following: More...
#include <RotationMatrix.h>
Inherits blaze::DenseMatrix< RotationMatrix< Type >, false >.
Public Types | |
typedef RotationMatrix< Type > | This |
Type of this RotationMatrix instance. | |
typedef This | ResultType |
Result type for expression template evaluations. | |
typedef Type | ElementType |
Type of the matrix elements. | |
typedef const RotationMatrix & | CompositeType |
Data type for composite expression templates. | |
typedef MT | MatrixType |
Type of the matrix. | |
Public Member Functions | |
template<typename Other > | |
RotationMatrix< Type > & | operator= (const RotationMatrix< Other > &rhs) |
Assignment operator for different RotationMatrix instances. More... | |
template<typename Other > | |
RotationMatrix< Type > & | operator*= (const RotationMatrix< Other > &rhs) |
Multiplication assignment operator for the multiplication between two rotation matrices ( ![]() | |
MatrixType & | operator~ () |
Conversion operator for non-constant matrices. More... | |
const MatrixType & | operator~ () const |
Conversion operator for constant matrices. More... | |
Operators | |
RotationMatrix & | operator= (const RotationMatrix &rhs) |
Copy assignment operator for RotationMatrix. More... | |
template<typename Other > | |
RotationMatrix & | operator= (const RotationMatrix< Other > &rhs) |
Type | operator[] (size_t index) const |
1D-access to the rotation matrix elements. More... | |
Type | operator() (size_t i, size_t j) const |
2D-access to the rotation matrix elements. More... | |
template<typename Other > | |
RotationMatrix & | operator*= (const RotationMatrix< Other > &rhs) |
Utility functions | |
size_t | rows () const |
Returns the current number of rows of the rotation matrix. More... | |
size_t | columns () const |
Returns the current number of columns of the rotation matrix. More... | |
void | reset () |
Reset to the default initial values. More... | |
Type | getDeterminant () const |
Calculation of the determinant of the rotation matrix. More... | |
RotationMatrix & | transpose () |
Transposing the rotation matrix. More... | |
RotationMatrix & | invert () |
Inverting the matrix. More... | |
void | swap (RotationMatrix &m) |
Swapping the contents of two 3x3 matrices. More... | |
Expression template evaluation functions | |
template<typename Other > | |
bool | isAliased (const Other *alias) const |
Returns whether the rotation matrix is aliased with the given address alias. More... | |
Math functions | |
template<typename Other > | |
const StaticMatrix< typename MultTrait< Type, Other >::Type, 3UL, 3UL, false > | rotate (const StaticMatrix< Other, 3UL, 3UL, false > &m) const |
Rotation of a matrix M ( ![]() | |
template<typename Other > | |
const StaticMatrix< typename MultTrait< Type, Other >::Type, 3UL, 3UL, false > | diagRotate (const StaticMatrix< Other, 3UL, 3UL, false > &m) const |
Rotation of a diagonal matrix M ( ![]() | |
Euler rotations | |
For the classification of the Euler rotation, the following characteristics are defined:
Altogether, there are 24 possible Euler rotations. The possibilities are consisting of the choice of the inner axis (X,Y or Z), the parity (even or odd), repetition (yes or no) and the frame (static or rotating). E.g., an Euler order of XYZs stands for the rotation order of x-, y- and z-axis in a static frame (inner axis: X, parity: even, repetition: no, frame: static), whereas YXYr stands for the rotation order y-, x- and y-axis in a rotating frame ( inner axis: Y, parity: odd, repetition: yes, frame: rotating). | |
const StaticVector< Type, 3UL > | getEulerAnglesXYZ () const |
Calculation of the Euler angles (in radian measure). More... | |
const StaticVector< Type, 3UL > | getEulerAngles (EulerRotation order) const |
Calculation of the Euler angles for a specific rotation order. More... | |
Private Attributes | |
Member variables | |
Type | v_ [9] |
The nine statically allocated matrix elements. More... | |
Constructors | |
RotationMatrix () | |
The default constructor for RotationMatrix. More... | |
template<typename Axis > | |
RotationMatrix (StaticVector< Axis, 3UL > axis, Type angle) | |
Rotation matrix constructor. More... | |
RotationMatrix (const RotationMatrix &m) | |
The copy constructor for RotationMatrix. More... | |
template<typename Other > | |
RotationMatrix (const RotationMatrix< Other > &m) | |
Conversion constructor from different RotationMatrix instances. More... | |
RotationMatrix (Type xx, Type xy, Type xz, Type yx, Type yy, Type yz, Type zx, Type zy, Type zz) | |
Constructor for a direct initialization of all rotation matrix elements. More... | |
Efficient, generic implementation of a 3x3 rotation matrix.
The RotationMatrix class is the representation of a 3x3 rotation matrix with a total of 9 statically allocated elements of arbitrary type. The naming convention of the elements is as following:
These elements can be accessed directly with the 1D subscript operator or with the 2D function operator. The numbering of the matrix elements is
Note: The RotationMatrix class can only be instantiated for non-cv-qualified floating point types! Therefore the only possible RotationMatrix instantiations are
The attempt to create a rotation matrix with an integral data type results in a compile time error.
|
inlineexplicit |
The default constructor for RotationMatrix.
The diagonal matrix elements are initialized with 1, all other elements are initialized with 0.
|
explicit |
Rotation matrix constructor.
axis | The rotation axis. |
angle | The rotation angle (radian measure). |
This constructor creates a rotation matrix from the rotation axis axis and the rotation angle angle. axis may be an arbitrary, non-zero vector of any length. However, it is allowed to use the zero vector (0,0,0) in combination with an angle of 0. This combination results in the default rotation matrix
|
inline |
The copy constructor for RotationMatrix.
m | Rotation matrix to be copied. |
The copy constructor is explicitly defined in order to enable/facilitate NRV optimization.
|
inline |
Conversion constructor from different RotationMatrix instances.
m | Rotation matrix to be copied. |
|
inlineexplicitprivate |
Constructor for a direct initialization of all rotation matrix elements.
xx | The initial value for the xx-component. |
xy | The initial value for the xy-component. |
xz | The initial value for the xz-component. |
yx | The initial value for the yx-component. |
yy | The initial value for the yy-component. |
yz | The initial value for the yz-component. |
zx | The initial value for the zx-component. |
zy | The initial value for the zy-component. |
zz | The initial value for the zz-component. |
|
inline |
Returns the current number of columns of the rotation matrix.
|
inline |
Rotation of a diagonal matrix M ( ).
m | The diagonal matrix to be rotated. |
The DiagRotate function is a special case of the rotate function. The matrix is assumed to be a diagonal matrix, which reduces the number of floating point operations of the rotation. The function is selected for matrices of different data type (in case Type and Other are supported by the MultTrait class). The function returns a matrix of the higher-order data type of the two involved data types.
Note: This function is only defined for matrices of floating point type. The attempt to use this function with matrices of integral data type will result in a compile time error.
|
inline |
Calculation of the determinant of the rotation matrix.
const StaticVector< Type, 3UL > blaze::RotationMatrix< Type >::getEulerAngles | ( | EulerRotation | order | ) | const |
Calculation of the Euler angles for a specific rotation order.
order | The specific rotation order. |
|
inline |
Calculation of the Euler angles (in radian measure).
The Euler angles are calculated for a rotation order of x-, y- and z-axis.
|
inline |
Inverting the matrix.
This function has the same effect as the transpose() function ( ).
|
inline |
Returns whether the rotation matrix is aliased with the given address alias.
alias | The alias to be checked. |
|
inline |
2D-access to the rotation matrix elements.
i | Access index for the row. The index has to be in the range [0..2]. |
j | Access index for the column. The index has to be in the range [0..2]. |
|
inline |
Multiplication assignment operator for the multiplication between two rotation matrices ( ).
rhs | The right-hand side rotation matrix for the multiplication. |
|
inline |
Copy assignment operator for RotationMatrix.
rhs | Rotation matrix to be copied. |
Explicit definition of a copy assignment operator for performance reasons.
|
inline |
Assignment operator for different RotationMatrix instances.
rhs | Rotation matrix to be copied. |
|
inline |
1D-access to the rotation matrix elements.
index | Access index. The index has to be in the range ![]() |
In case BLAZE_USER_ASSERT() is active, this operator performs an index check.
|
inlineinherited |
Conversion operator for non-constant matrices.
|
inlineinherited |
Conversion operator for constant matrices.
|
inline |
Reset to the default initial values.
This function resets the rotation matrix to the default initial values:
|
inline |
Rotation of a matrix M ( ).
m | The matrix to be rotated. |
The function is selected for matrices of different data type (in case Type and Other are supported by the MultTrait class). The function returns a matrix of the higher-order data type of the two involved data types.
Note: This function is only defined for matrices of floating point type. The attempt to use this function with matrices of integral data type will result in a compile time error.
|
inline |
Returns the current number of rows of the rotation matrix.
|
inline |
Swapping the contents of two 3x3 matrices.
m | The matrix to be swapped. |
no-throw | guarantee. |
|
inline |
Transposing the rotation matrix.
This function has the same effect as the invert() function ( ).
|
private |
The nine statically allocated matrix elements.
Access to the matrix elements is gained via the subscript or function call operator. The order of the elements is