Quaternion A simple class that implements the main features of quaternion algebra.
More...
#include <quaternion.h>
template<class T>
class Kratos::Quaternion< T >
Quaternion A simple class that implements the main features of quaternion algebra.
◆ const_reference
◆ reference
◆ value_type
◆ Quaternion() [1/3]
◆ Quaternion() [2/3]
Creates a Quaternion from its coefficients.
- Parameters
-
w | w coefficient |
x | x coefficient |
y | y coefficient |
z | z coefficient |
◆ Quaternion() [3/3]
◆ ~Quaternion()
◆ conjugate()
Returns the Conjugate of this Quaternion, which represents the opposite rotation
- Returns
- the Conjugate of this Quaternion
◆ FromAxisAngle()
Returns a Quaternion that represents a rotation of an angle 'radians' around the axis (x, y, z)
- Parameters
-
x | the x component of the rotation axis |
y | the y component of the rotation axis |
z | the z component of the rotation axis |
radians | the rotation angle in radians |
- Returns
- a Quaternion that represents a rotation of an angle 'radians' around the axis (x, y, z)
◆ FromEulerAngles()
Returns a Quaternion from Euler Angles. Euler Angles expresed in Z(-X)Z sequence as in GiD
- Parameters
-
EA | the source rotation Euler Angles |
- Returns
- a Quaternion from a Euler Angles
◆ FromRotationMatrix()
template<class T >
template<class TMatrix3x3 >
Returns a Quaternion from a Rotation Matrix. The rotation matrix type is the template argument, no check is made on the type of this matrix. These assumptions are made: The matrix should provide an indexed access like m(i, j) where i and j are indices from 0 to 2. This means that the input matrix is a C-Style 3x3 Matrix.
- Parameters
-
m | the source rotation matrix |
- Returns
- a Quaternion from a Rotation Matrix
◆ FromRotationVector() [1/2]
template<class T >
template<class TVector3 >
Returns a Quaternion from a rotation vector. The vector type is the template parameter. No check is made on this type. The following assumptions are made: The vector type should provide indexing like vector(i) where i goes from 0 to 2. (i.e. a C-Style vector of size 3)
- Parameters
-
v | the source rotation vector |
- Returns
- a Quaternion from a rotation vector
◆ FromRotationVector() [2/2]
Returns a Quaternion from a rotation vector
- Parameters
-
rx | the x component of the source rotation vector |
ry | the y component of the source rotation vector |
rz | the z component of the source rotation vector |
- Returns
- a Quaternion from a rotation vector
◆ Identity()
◆ KRATOS_CLASS_POINTER_DEFINITION()
◆ KRATOS_DEPRECATED_MESSAGE() [1/4]
template<class T >
Kratos::Quaternion< T >::KRATOS_DEPRECATED_MESSAGE |
( |
"Deprecated method due to style" |
| ) |
const |
|
inline |
Returns the W coefficient of this quaternion.
- Returns
- the W coefficient of this quaternion.
◆ KRATOS_DEPRECATED_MESSAGE() [2/4]
template<class T >
Kratos::Quaternion< T >::KRATOS_DEPRECATED_MESSAGE |
( |
"Deprecated method due to style" |
| ) |
const |
|
inline |
Returns the X coefficient of this quaternion.
- Returns
- the X coefficient of this quaternion.
◆ KRATOS_DEPRECATED_MESSAGE() [3/4]
template<class T >
Kratos::Quaternion< T >::KRATOS_DEPRECATED_MESSAGE |
( |
"Deprecated method due to style" |
| ) |
const |
|
inline |
Returns the Y coefficient of this quaternion.
- Returns
- the Y coefficient of this quaternion.
◆ KRATOS_DEPRECATED_MESSAGE() [4/4]
template<class T >
Kratos::Quaternion< T >::KRATOS_DEPRECATED_MESSAGE |
( |
"Deprecated method due to style" |
| ) |
const |
|
inline |
Returns the Z coefficient of this quaternion.
- Returns
- the Z coefficient of this quaternion.
◆ norm()
Returns the norm of this quaternion. sqrt(x*x + y*y + z*z + w*w)
- Returns
- the norm of this quaternion.
◆ normalize()
◆ operator=() [1/2]
template<class T >
template<class AE >
◆ operator=() [2/2]
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ PrintData()
◆ PrintInfo()
◆ RotateVector3() [1/2]
template<class T >
template<class TVector3_A , class TVector3_B >
void Kratos::Quaternion< T >::RotateVector3 |
( |
const TVector3_A & |
a, |
|
|
TVector3_B & |
b |
|
) |
| const |
|
inline |
Rotates a vector using this quaternion. Note: this is faster than constructing the rotation matrix and perform the matrix multiplication for a single vector. The vector type is the template parameter. No check is made on this type. The following assumptions are made: The vector type should provide indexing like vector(i) where i goes from 0 to 2. (i.e. a C-Style vector of size 3)
- Parameters
-
a | the input source vector |
b | the output rotated vector |
◆ RotateVector3() [2/2]
template<class T >
template<class TVector3 >
Rotates a vector using this quaternion. Note: this is faster than constructing the rotation matrix and perform the matrix multiplication for a single vector. The vector type is the template parameter. No check is made on this type. The following assumptions are made: The vector type should provide indexing like vector(i) where i goes from 0 to 2. (i.e. a C-Style vector of size 3)
- Parameters
-
a | the input source vector - rotated on exit |
◆ SetW()
◆ SetX()
◆ SetY()
◆ SetZ()
◆ squaredNorm()
Returns the squared norm of this quaternion. x*x + y*y + z*z + w*w
- Returns
- the squared norm of this quaternion.
◆ ToEulerAngles()
Constructs the Euler Angles from this Quaternion. Euler Angles expresed in Z(-X)Z sequence as in GiD
- Parameters
-
EA | the output rotation matrix |
◆ ToRotationMatrix()
template<class T >
template<class TMatrix3x3 >
Constructs a Rotation Matrix from this Quaternion. The rotation matrix type is the template argument, no check is made on the type of this matrix. These assumptions are made: The matrix should provide an indexed access like m(i, j) where i and j are indices from 0 to 2. This means that the input matrix is a C-Style 3x3 Matrix. All the 9 coefficients are properly set so there's no need to set the matrix to Zero before calling this function.
- Parameters
-
R | the output rotation matrix |
◆ ToRotationVector() [1/2]
Extracts the Rotation Vector from this Quaternion
- Parameters
-
rx | the output x component if the rotation vector |
ry | the output y component if the rotation vector |
rz | the output z component if the rotation vector |
◆ ToRotationVector() [2/2]
template<class T >
template<class TVector3 >
Extracts the Rotation Vector from this Quaternion The vector type is the template parameter. No check is made on this type. The following assumptions are made: The vector type should provide indexing like vector(i) where i goes from 0 to 2. (i.e. a C-Style vector of size 3)
- Parameters
-
v | the output rotation vector |
◆ W()
◆ X()
◆ Y()
◆ Z()
◆ Serializer
The documentation for this class was generated from the following file:
- /home/runner/work/Documentation/Documentation/master/kratos/utilities/quaternion.h