|
cisst-saw
|
Define a rotation quaternion for a space of dimension 3. More...
#include <vctQuaternionRotation3Base.h>
Public Types | |
| enum | { SIZE = 4 } |
| enum | { DIMENSION = 3 } |
| typedef vctQuaternionBase< _containerType > | BaseType |
| typedef _containerType | ContainerType |
| typedef vctQuaternionRotation3Base< _containerType > | ThisType |
| typedef cmnTypeTraits< value_type > | TypeTraits |
| Public Types inherited from vctQuaternionBase< _containerType > | |
| enum | { SIZE = 4 } |
| typedef _containerType | BaseType |
| typedef _containerType | ContainerType |
| typedef vctQuaternionBase< _containerType > | ThisType |
| typedef cmnTypeTraits< value_type > | TypeTraits |
Public Member Functions | |
| VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type) | |
| vctQuaternionRotation3Base (void) | |
| vctQuaternionRotation3Base (const ThisType &quaternionRotation) | |
| ThisType & | operator= (const ThisType &quaternionRotation) |
Constructors with normalization test. | |
These constructors will check that the input is valid, i.e. normalized. If the input is not normalized, an exception (of type
| |
| vctQuaternionRotation3Base (const value_type &x, const value_type &y, const value_type &z, const value_type &r) CISST_THROW(std | |
| template<class __containerType> | |
| vctQuaternionRotation3Base (const vctMatrixRotation3Base< __containerType > &matrixRotation) CISST_THROW(std | |
| vctQuaternionRotation3Base (const vctAxisAngleRotation3< value_type > &axisAngleRotation) CISST_THROW(std | |
| template<class __containerType> | |
| vctQuaternionRotation3Base (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) CISST_THROW(std | |
Conversion from normalized input. | |
These methods will check that the input is normalized. If the input is not normalized, an exception (
| |
| ThisType & | From (value_type x, value_type y, value_type z, value_type r) CISST_THROW(std |
| ThisType & | From (const vctAxisAngleRotation3< value_type > axisAngleRotation) CISST_THROW(std |
| template<class __containerType> | |
| ThisType & | From (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) CISST_THROW(std |
| template<class __containerType> | |
| ThisType & | From (const vctMatrixRotation3Base< __containerType > &matrixRotation) CISST_THROW(std |
Conversion and normalization. | |
These method will accept any input and attempt to either normalize the input and then convert or convert and then normalize the quaternion itself. | |
| template<class __containerType> | |
| ThisType & | FromNormalized (const vctQuaternionRotation3Base< __containerType > &other) |
| ThisType & | FromNormalized (value_type x, value_type y, value_type z, value_type r) |
| ThisType & | FromNormalized (const vctAxisAngleRotation3< value_type > axisAngleRotation) |
| template<class __containerType> | |
| ThisType & | FromNormalized (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) |
| template<class __containerType> | |
| ThisType & | FromNormalized (const vctMatrixRotation3Base< __containerType > &matrixRotation) |
Conversion. | |
These method don't check if the input is normalized nor try to normalize the results. They should be used with caution since the resulting rotation (in this case a quaternion) might not be normalized. | |
| template<class __containerType> | |
| ThisType & | FromRaw (const vctQuaternionRotation3Base< __containerType > &other) |
| ThisType & | FromRaw (value_type x, value_type y, value_type z, value_type r) |
| ThisType & | FromRaw (const vctAxisAngleRotation3< value_type > axisAngleRotation) |
| template<class __containerType> | |
| ThisType & | FromRaw (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) |
| template<class __containerType> | |
| ThisType & | FromRaw (const vctMatrixRotation3Base< __containerType > &matrixRotation) |
| ThisType & | From (const ThisType &otherRotation) |
| ThisType & | NormalizedOf (const ThisType &otherQuaternion) |
| ThisType & | NormalizedSelf (void) |
| ThisType | Normalized (void) const |
| ThisType & | InverseSelf (void) |
| ThisType & | InverseOf (const ThisType &otherRotation) |
| ThisType | Inverse (void) const |
| template<stride_type __stride1, class __dataPtrType1, stride_type __stride2, class __dataPtrType2> | |
| void | ApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const |
| template<class __vectorOwnerType, stride_type __stride, class __dataPtrType> | |
| void | ApplyTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input, vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &output) const |
| template<stride_type __stride, class __dataPtrType> | |
| vctFixedSizeVector< value_type, DIMENSION > | ApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const |
| template<class __vectorOwnerType> | |
| vctFixedSizeVector< value_type, DIMENSION > | ApplyTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input) const |
| template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1, stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2> | |
| void | ApplyTo (const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &input, vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &output) const |
| template<class __matrixOwnerType1, class __matrixOwnerType2> | |
| void | ApplyTo (const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &input, vctDynamicMatrixBase< __matrixOwnerType2, value_type > &output) const |
| void | ApplyTo (const ThisType &input, ThisType &output) const |
| ThisType | ApplyTo (const ThisType &input) const |
| template<class _vectorOwnerType1, class _vectorOwnerType2> | |
| void | ApplyTo (const vctDynamicConstVectorBase< _vectorOwnerType1, value_type > &input, vctDynamicVectorBase< _vectorOwnerType2, value_type > &output) const |
| template<stride_type __stride1, class __dataPtrType1, stride_type __stride2, class __dataPtrType2> | |
| void | ApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &input, vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &output) const |
| template<class __vectorOwnerType, stride_type __stride, class __dataPtrType> | |
| void | ApplyInverseTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input, vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &output) const |
| template<stride_type __stride, class __dataPtrType> | |
| vctFixedSizeVector< value_type, DIMENSION > | ApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const |
| template<class __vectorOwnerType> | |
| vctFixedSizeVector< value_type, DIMENSION > | ApplyInverseTo (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &input) const |
| template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1, stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2> | |
| void | ApplyInverseTo (const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > &input, vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > &output) const |
| void | ApplyInverseTo (const ThisType &input, ThisType &output) const |
| ThisType | ApplyInverseTo (const ThisType &input) const |
| template<class _vectorOwnerType1, class _vectorOwnerType2> | |
| void | ApplyInverseTo (const vctDynamicConstVectorBase< _vectorOwnerType1, value_type > &input, vctDynamicVectorBase< _vectorOwnerType2, value_type > &output) const |
| template<class __matrixOwnerType1, class __matrixOwnerType2> | |
| void | ApplyInverseTo (const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > &input, vctDynamicMatrixBase< __matrixOwnerType2, value_type > &output) const |
| bool | AlmostEquivalent (const ThisType &other, value_type tolerance=TypeTraits::Tolerance()) const |
| ThisType | operator* (const ThisType &input) const |
Deprecated methods | |
| template<stride_type __stride, class __dataPtrType> | |
| CISST_DEPRECATED const ThisType & | From (const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &axis, const AngleType &angle) |
| template<stride_type __stride, class __dataPtrType> | |
| CISST_DEPRECATED void | GetAxisAngle (vctFixedSizeVectorBase< 3, __stride, value_type, __dataPtrType > &axis, value_type &angle) |
| Public Member Functions inherited from vctQuaternionBase< _containerType > | |
| VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type) | |
| vctQuaternionBase (void) | |
| vctQuaternionBase (const value_type &x, const value_type &y, const value_type &z, const value_type &r) | |
| const_reference | R (void) const |
| reference | R (void) |
| template<class __containerTypeOther> | |
| ThisType & | ConjugateOf (const vctQuaternionBase< __containerTypeOther > &otherQuaternion) |
| ThisType & | ConjugateSelf (void) |
| ThisType | Conjugate (void) const |
| template<class __containerType1, class __containerType2> | |
| ThisType & | ProductOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2) |
| template<class __containerType1, class __containerType2> | |
| ThisType & | QuotientOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2) |
| template<class __containerTypeOther> | |
| ThisType & | PostMultiply (const vctQuaternionBase< __containerTypeOther > &other) |
| template<class __containerTypeOther> | |
| ThisType & | PreMultiply (const vctQuaternionBase< __containerTypeOther > &other) |
| template<class __containerTypeOther> | |
| ThisType & | Divide (const vctQuaternionBase< __containerTypeOther > &other) |
| ThisType & | Divide (const value_type s) |
Protected Member Functions | |
| void | ThrowUnlessIsNormalized (void) const CISST_THROW(std |
| template<class _inputType> | |
| void | ThrowUnlessIsNormalized (const _inputType &input) const CISST_THROW(std |
| void | Allocate (void) |
| Protected Member Functions inherited from vctQuaternionBase< _containerType > | |
| void | Allocate (void) |
| void | Allocate (void) |
| void | Allocate (void) |
Constructors without normalization test | |
These constructors will either assume that the input is normalized or normalize the input (a copy of it, if required) based on the last parameter provided.
| |
| vctQuaternionRotation3Base (const ThisType &quaternionRotation, bool normalizeInput) | |
| vctQuaternionRotation3Base (const value_type &x, const value_type &y, const value_type &z, const value_type &r, bool normalizeInput) | |
| template<class __containerType> | |
| vctQuaternionRotation3Base (const vctMatrixRotation3Base< __containerType > &matrixRotation, bool normalizeInput) | |
| vctQuaternionRotation3Base (const vctAxisAngleRotation3< value_type > &axisAngleRotation, bool normalizeInput) | |
| template<class __containerType> | |
| vctQuaternionRotation3Base (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation, bool normalizeInput) | |
| static CISST_EXPORT const ThisType & | Identity () |
Define a rotation quaternion for a space of dimension 3.
This class is templated by the element type. It is derived from vctQuaternionBase. This class is templated by the type of container used to store the quaternion. It is an "inner" class of the library, i.e. a regular user should use either the predefined type vctQuatRot3 or the class vctQuaternionRotation3.
| _containerType | The type of container used for the quaternion. |
| typedef vctQuaternionBase<_containerType> vctQuaternionRotation3Base< _containerType >::BaseType |
Type of base class.
| typedef _containerType vctQuaternionRotation3Base< _containerType >::ContainerType |
Type of container. This must be a vector of 4 elements (either fixed size or dynamic). In any case, this class should only be used by the library programmers.
| typedef vctQuaternionRotation3Base<_containerType> vctQuaternionRotation3Base< _containerType >::ThisType |
| typedef cmnTypeTraits<value_type> vctQuaternionRotation3Base< _containerType >::TypeTraits |
|
inline |
Default constructor. Sets the rotation quaternion to identity.
|
inline |
Copy constructor.
| quaternionRotation | A rotation quaternion. |
|
inline |
Constructor from 4 elements.
| x | First component of the real part. |
| y | Second component of the real part. |
| z | Third component of the real part. |
| r | The imaginary part. |
|
inlineexplicit |
Constructor from a rotation matrix.
| matrixRotation | A rotation matrix. |
|
inline |
Constructor from an axis and angle.
| axisAngleRotation | An axis/angle rotation. |
|
inline |
Constructor from a Rodriguez rotation.
| rodriguezRotation | A Rodriguez rotation. |
|
inline |
Copy constructor.
| quaternionRotation | A rotation quaternion. |
| normalizeInput | Force the input normalization. |
|
inline |
Constructor from 4 elements.
| x | First component of the real part. |
| y | Second component of the real part. |
| z | Third component of the real part. |
| r | The imaginary part. |
| normalizeInput | Force the input normalization. |
|
inlineexplicit |
Constructor from a rotation matrix.
| matrixRotation | A rotation matrix. |
| normalizeInput | Force the input normalization. |
|
inline |
Constructor from an axis and angle.
| axisAngleRotation | An axis/angle rotation. |
| normalizeInput | Force the input normalization. |
|
inline |
Constructor from a Rodriguez rotation.
| rodriguezRotation | A Rodriguez rotation. |
| normalizeInput | Force the input normalization. |
|
inlineprotected |
Allocate memory for the underlying container if needed. By default, this methods does nothing. For any container requiring a memory allocation, it is necessary to specialize this method.
|
inline |
Return true if this quaternion rotation is equivalent to the other quaternion rotation, up to the given tolerance. Quaternion rotation may be effectively equivalent if one is elementwise equal to the other, or if one is the negation of the other.
The tolerance factor is used to compare each of the elements of the difference vector.
|
inline |
Apply the inverse of the rotation to another rotation. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.
| input | The input rotation |
|
inline |
Apply the inverse of the rotation to another rotation. The result is stored into a vctQuaternionRotation3Base (ThisType) provided by the caller and passed by reference.
| input | The input rotation |
| output | The output rotation |
|
inline |
Apply this rotation inverse to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.
|
inline |
|
inline |
|
inline |
Apply the the inverse of the rotation to a dynamic vector. The result is stored into another dynamic vector passed by reference by the caller. It is assumed that both are of size 3.
|
inline |
Apply this inverse rotation to a fixed size matrix with 3 rows. The result is stored in another fixed matrix.
|
inline |
Apply the the inverse of the rotation to a vector of fixed size 3. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.
| input | The input vector |
|
inline |
Apply the inverse of the rotation to a vector of fixed size
| input | The input vector |
| output | The output vector |
|
inline |
Apply the rotation to another rotation. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.
| input | The input rotation |
|
inline |
Apply the rotation to another rotation. The result is stored into a vctQuaternionRotation3Base (ThisType) provided by the caller and passed by reference.
| input | The input rotation |
| output | The output rotation |
|
inline |
Apply this rotation to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.
|
inline |
|
inline |
|
inline |
Apply the rotation to a dynamic vector. The result is stored into another dynamic vector passed by reference by the caller. It is assumed that both are of size 3.
|
inline |
Apply this rotation to a fixed size matrix with 3 rows. The result is stored in another fixed matrix.
|
inline |
Apply the rotation to a vector of fixed size 3. The result is returned by copy. This interface might be more convenient for some but one should note that it is less efficient since it requires a copy.
| input | The input vector |
|
inline |
Apply the rotation to a vector of fixed size 3. The result is stored into a vector of size 3 provided by the caller and passed by reference.
| input | The input vector |
| output | The output vector |
|
inline |
A complementary form of assigning one quaternion rotation to another. The method is provided mostly for generic programming interfaces, and for testing various operations on rotations
|
inline |
Conversion from axis/angle.
|
inline |
Convert from a unit vector and an angle. It is important to note that this method doesn't normalize the axis vector but asserts that it is normalized (in debug mode only).
| axis | A unit vector of size 3. |
| angle | The angle in radian |
|
inline |
Conversion from a rotation matrix.
|
inline |
Conversion from a Rodriguez rotation.
|
inline |
Conversion from 4 numbers. This method actually performs an assignement and then check that the result is normalized.
|
inline |
Conversion from axis/angle.
|
inline |
Conversion from a rotation matrix.
This method could normalize the input first, but the rotation matrix normalization relies on -1- a conversion to quaternion, -2- normalization and -3- a conversion back to rotation matrix. Therefore it converts to quaternion and then normalizes the resulting quaternion (this).
|
inline |
Conversion from another quaternion. This method actually performs an assignement and then normalize the quaternion (this).
|
inline |
Conversion from a Rodriguez rotation.
|
inline |
Conversion from 4 numbers. This method actually performs an assignement and then normalize the quaternion (this).
|
inline |
|
inline |
Conversion from a rotation matrix. The algorithm is based on http://www.j3d.org/matrix_faq/matrfaq_latest.html. This method is important since we use it to convert a rotation matrix to a quaternion to normalize the matrix. The method From can not be used since it asserts that the input matrix is already normalized.
| matrixRotation | A rotation matrix |
|
inline |
|
inline |
Conversion from a Rodriguez rotation.
|
inline |
|
inline |
Convert from ``Rodriguez rotation'' to rotation quaternion. A Rodriguez rotation is a 3-element vector whose direction is the rotation axis, and magnitude is the rotation angle in radians.
| rodriguezRotation | the Rodriguez rotation |
/*! Convert to an axis and angle representation. It is important to note that this method doesn't check if the rotation quaternion is normalized or not.
| axis | The axis of the rotation |
| angle | The angle around the axis to match the rotation |
|
static |
Const reference to the identity. In this case, (0, 0, 0, 1)
|
inline |
Create and return by copy the inverse of this matrix. This method is not the most efficient since it requires a copy.
|
inline |
Set this rotation as the inverse of another one.
|
inline |
Inverse this rotation quaternion. This methods assumes that the quaternion is normalized and sets this unit quaternion as its transposed.
|
inline |
Returns the normalized version of this quaternion rotation. This method returns a copy of the normalized version and does not modify this quaternion.
|
inline |
Sets this rotation quaternion as the normalized version of another one.
| otherQuaternion | rotation quaternion used to compute the normalized quaternion. |
|
inline |
Normalizes this quaternion rotation.
|
inline |
Multiply two rotation quaternions and return the result as a normalized rotation quaternion.
|
inline |
|
inlineprotected |
Throw an exception unless the input is normalized.
| input | An object with IsNormalized method. |
|
inlineprotected |
Throw an exception unless this rotation is normalized.
| vctQuaternionRotation3Base< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS | ( | typename ContainerType::value_type | ) |