cisst-saw
Loading...
Searching...
No Matches
vctQuaternionRotation3Base< _containerType > Class Template Reference

Define a rotation quaternion for a space of dimension 3. More...

#include <vctQuaternionRotation3Base.h>

Inheritance diagram for vctQuaternionRotation3Base< _containerType >:
vctQuaternionBase< _containerType > vctQuaternionRotation3< value_type > vctQuaternionRotation3< double > vctQuaternionRotation3< float >

Public Types

enum  { SIZE = 4 }
enum  { DIMENSION = 3 }
typedef vctQuaternionBase< _containerType > BaseType
typedef _containerType ContainerType
typedef vctQuaternionRotation3Base< _containerType > ThisType
typedef cmnTypeTraits< value_typeTypeTraits
Public Types inherited from vctQuaternionBase< _containerType >
enum  { SIZE = 4 }
typedef _containerType BaseType
typedef _containerType ContainerType
typedef vctQuaternionBase< _containerType > ThisType
typedef cmnTypeTraits< value_typeTypeTraits

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type)
 vctQuaternionRotation3Base (void)
 vctQuaternionRotation3Base (const ThisType &quaternionRotation)
ThisTypeoperator= (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 std::runtime_error) will be thrown. Each constructor uses the corresponding From() method based on the input type.

Note
See the cmnThrow() function if an abort is better than an exception for your application.
 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 (std::runtime_error) will be thrown using cmnThrow().

Note
Since all exceptions are thrown using cmnThrow(), it is possible to configure these methods to use abort() if the normalization requirements are not met (see cmnThrow()).
ThisTypeFrom (value_type x, value_type y, value_type z, value_type r) CISST_THROW(std
ThisTypeFrom (const vctAxisAngleRotation3< value_type > axisAngleRotation) CISST_THROW(std
template<class __containerType>
ThisTypeFrom (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) CISST_THROW(std
template<class __containerType>
ThisTypeFrom (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.
The order depends on the type of input.

template<class __containerType>
ThisTypeFromNormalized (const vctQuaternionRotation3Base< __containerType > &other)
ThisTypeFromNormalized (value_type x, value_type y, value_type z, value_type r)
ThisTypeFromNormalized (const vctAxisAngleRotation3< value_type > axisAngleRotation)
template<class __containerType>
ThisTypeFromNormalized (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation)
template<class __containerType>
ThisTypeFromNormalized (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>
ThisTypeFromRaw (const vctQuaternionRotation3Base< __containerType > &other)
ThisTypeFromRaw (value_type x, value_type y, value_type z, value_type r)
ThisTypeFromRaw (const vctAxisAngleRotation3< value_type > axisAngleRotation)
template<class __containerType>
ThisTypeFromRaw (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation)
template<class __containerType>
ThisTypeFromRaw (const vctMatrixRotation3Base< __containerType > &matrixRotation)
ThisTypeFrom (const ThisType &otherRotation)
ThisTypeNormalizedOf (const ThisType &otherQuaternion)
ThisTypeNormalizedSelf (void)
ThisType Normalized (void) const
ThisTypeInverseSelf (void)
ThisTypeInverseOf (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, DIMENSIONApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
template<class __vectorOwnerType>
vctFixedSizeVector< value_type, DIMENSIONApplyTo (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, DIMENSIONApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
template<class __vectorOwnerType>
vctFixedSizeVector< value_type, DIMENSIONApplyInverseTo (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 ThisTypeFrom (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>
ThisTypeConjugateOf (const vctQuaternionBase< __containerTypeOther > &otherQuaternion)
ThisTypeConjugateSelf (void)
ThisType Conjugate (void) const
template<class __containerType1, class __containerType2>
ThisTypeProductOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2)
template<class __containerType1, class __containerType2>
ThisTypeQuotientOf (const vctQuaternionBase< __containerType1 > &quat1, const vctQuaternionBase< __containerType2 > &quat2)
template<class __containerTypeOther>
ThisTypePostMultiply (const vctQuaternionBase< __containerTypeOther > &other)
template<class __containerTypeOther>
ThisTypePreMultiply (const vctQuaternionBase< __containerTypeOther > &other)
template<class __containerTypeOther>
ThisTypeDivide (const vctQuaternionBase< __containerTypeOther > &other)
ThisTypeDivide (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.

  • If the normalization flag is set to VCT_DO_NOT_NORMALIZE, the input is considered already normalized and the constructor will not perform any sanity check. This can lead to numerical instabilities which have to be handled by the caller.

  • If the normalization flag is set to VCT_NORMALIZE, the input will be normalized. This option should be used whenever it is important to obtain a result as "normalized" as possible.

 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 ThisTypeIdentity ()

Detailed Description

template<class _containerType>
class vctQuaternionRotation3Base< _containerType >

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.

Parameters
_containerTypeThe type of container used for the quaternion.
See also
vctQuaternionRotation3, vctQuaternionBase

Member Typedef Documentation

◆ BaseType

template<class _containerType>
typedef vctQuaternionBase<_containerType> vctQuaternionRotation3Base< _containerType >::BaseType

Type of base class.

◆ ContainerType

template<class _containerType>
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.

◆ ThisType

template<class _containerType>
typedef vctQuaternionRotation3Base<_containerType> vctQuaternionRotation3Base< _containerType >::ThisType

◆ TypeTraits

template<class _containerType>
typedef cmnTypeTraits<value_type> vctQuaternionRotation3Base< _containerType >::TypeTraits

Member Enumeration Documentation

◆ anonymous enum

template<class _containerType>
anonymous enum
Enumerator
SIZE 

◆ anonymous enum

template<class _containerType>
anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

◆ vctQuaternionRotation3Base() [1/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( void )
inline

Default constructor. Sets the rotation quaternion to identity.

◆ vctQuaternionRotation3Base() [2/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const ThisType & quaternionRotation)
inline

Copy constructor.

Parameters
quaternionRotationA rotation quaternion.

◆ vctQuaternionRotation3Base() [3/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const value_type & x,
const value_type & y,
const value_type & z,
const value_type & r )
inline

Constructor from 4 elements.

Parameters
xFirst component of the real part.
ySecond component of the real part.
zThird component of the real part.
rThe imaginary part.

◆ vctQuaternionRotation3Base() [4/11]

template<class _containerType>
template<class __containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctMatrixRotation3Base< __containerType > & matrixRotation)
inlineexplicit

Constructor from a rotation matrix.

Parameters
matrixRotationA rotation matrix.

◆ vctQuaternionRotation3Base() [5/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctAxisAngleRotation3< value_type > & axisAngleRotation)
inline

Constructor from an axis and angle.

Parameters
axisAngleRotationAn axis/angle rotation.

◆ vctQuaternionRotation3Base() [6/11]

template<class _containerType>
template<class __containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctRodriguezRotation3Base< __containerType > & rodriguezRotation)
inline

Constructor from a Rodriguez rotation.

Parameters
rodriguezRotationA Rodriguez rotation.

◆ vctQuaternionRotation3Base() [7/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const ThisType & quaternionRotation,
bool normalizeInput )
inline

Copy constructor.

Parameters
quaternionRotationA rotation quaternion.
normalizeInputForce the input normalization.

◆ vctQuaternionRotation3Base() [8/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const value_type & x,
const value_type & y,
const value_type & z,
const value_type & r,
bool normalizeInput )
inline

Constructor from 4 elements.

Parameters
xFirst component of the real part.
ySecond component of the real part.
zThird component of the real part.
rThe imaginary part.
normalizeInputForce the input normalization.

◆ vctQuaternionRotation3Base() [9/11]

template<class _containerType>
template<class __containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctMatrixRotation3Base< __containerType > & matrixRotation,
bool normalizeInput )
inlineexplicit

Constructor from a rotation matrix.

Parameters
matrixRotationA rotation matrix.
normalizeInputForce the input normalization.

◆ vctQuaternionRotation3Base() [10/11]

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctAxisAngleRotation3< value_type > & axisAngleRotation,
bool normalizeInput )
inline

Constructor from an axis and angle.

Parameters
axisAngleRotationAn axis/angle rotation.
normalizeInputForce the input normalization.

◆ vctQuaternionRotation3Base() [11/11]

template<class _containerType>
template<class __containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctRodriguezRotation3Base< __containerType > & rodriguezRotation,
bool normalizeInput )
inline

Constructor from a Rodriguez rotation.

Parameters
rodriguezRotationA Rodriguez rotation.
normalizeInputForce the input normalization.

Member Function Documentation

◆ Allocate()

template<class _containerType>
void vctQuaternionRotation3Base< _containerType >::Allocate ( void )
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.

◆ AlmostEquivalent()

template<class _containerType>
bool vctQuaternionRotation3Base< _containerType >::AlmostEquivalent ( const ThisType & other,
value_type tolerance = TypeTraits::Tolerance() ) const
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.

See also
AlmostEqual

◆ ApplyInverseTo() [1/9]

template<class _containerType>
ThisType vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const ThisType & input) const
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.

Parameters
inputThe input rotation
Returns
The output rotation

◆ ApplyInverseTo() [2/9]

template<class _containerType>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const ThisType & input,
ThisType & output ) const
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.

Parameters
inputThe input rotation
outputThe output rotation

◆ ApplyInverseTo() [3/9]

template<class _containerType>
template<class __matrixOwnerType1, class __matrixOwnerType2>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > & input,
vctDynamicMatrixBase< __matrixOwnerType2, value_type > & output ) const
inline

Apply this rotation inverse to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.

◆ ApplyInverseTo() [4/9]

template<class _containerType>
template<class __vectorOwnerType>
vctFixedSizeVector< value_type, DIMENSION > vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > & input) const
inline

◆ ApplyInverseTo() [5/9]

template<class _containerType>
template<class __vectorOwnerType, stride_type __stride, class __dataPtrType>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > & input,
vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > & output ) const
inline

◆ ApplyInverseTo() [6/9]

template<class _containerType>
template<class _vectorOwnerType1, class _vectorOwnerType2>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< _vectorOwnerType1, value_type > & input,
vctDynamicVectorBase< _vectorOwnerType2, value_type > & output ) const
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.

◆ ApplyInverseTo() [7/9]

template<class _containerType>
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1, stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > & input,
vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > & output ) const
inline

Apply this inverse rotation to a fixed size matrix with 3 rows. The result is stored in another fixed matrix.

◆ ApplyInverseTo() [8/9]

template<class _containerType>
template<stride_type __stride, class __dataPtrType>
vctFixedSizeVector< value_type, DIMENSION > vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > & input) const
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.

Parameters
inputThe input vector
Returns
The output vector

◆ ApplyInverseTo() [9/9]

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1, stride_type __stride2, class __dataPtrType2>
void vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > & input,
vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > & output ) const
inline

Apply the inverse of the rotation to a vector of fixed size

  1. The result is stored into a vector of size 3 provided by the caller and passed by reference.
Parameters
inputThe input vector
outputThe output vector

◆ ApplyTo() [1/9]

template<class _containerType>
ThisType vctQuaternionRotation3Base< _containerType >::ApplyTo ( const ThisType & input) const
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.

Parameters
inputThe input rotation
Returns
The output rotation

◆ ApplyTo() [2/9]

template<class _containerType>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const ThisType & input,
ThisType & output ) const
inline

Apply the rotation to another rotation. The result is stored into a vctQuaternionRotation3Base (ThisType) provided by the caller and passed by reference.

Parameters
inputThe input rotation
outputThe output rotation

◆ ApplyTo() [3/9]

template<class _containerType>
template<class __matrixOwnerType1, class __matrixOwnerType2>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctDynamicConstMatrixBase< __matrixOwnerType1, value_type > & input,
vctDynamicMatrixBase< __matrixOwnerType2, value_type > & output ) const
inline

Apply this rotation to a dynamic matrix with 3 rows. The result is stored in another dynamic matrix.

◆ ApplyTo() [4/9]

template<class _containerType>
template<class __vectorOwnerType>
vctFixedSizeVector< value_type, DIMENSION > vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > & input) const
inline

◆ ApplyTo() [5/9]

template<class _containerType>
template<class __vectorOwnerType, stride_type __stride, class __dataPtrType>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > & input,
vctFixedSizeVectorBase< DIMENSION, __stride, value_type, __dataPtrType > & output ) const
inline

◆ ApplyTo() [6/9]

template<class _containerType>
template<class _vectorOwnerType1, class _vectorOwnerType2>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< _vectorOwnerType1, value_type > & input,
vctDynamicVectorBase< _vectorOwnerType2, value_type > & output ) const
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.

◆ ApplyTo() [7/9]

template<class _containerType>
template<size_type __cols, stride_type __rowStride1, stride_type __colStride1, class __dataPtrType1, stride_type __rowStride2, stride_type __colStride2, class __dataPtrType2>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctFixedSizeConstMatrixBase< DIMENSION, __cols, __rowStride1, __colStride1, value_type, __dataPtrType1 > & input,
vctFixedSizeMatrixBase< DIMENSION, __cols, __rowStride2, __colStride2, value_type, __dataPtrType2 > & output ) const
inline

Apply this rotation to a fixed size matrix with 3 rows. The result is stored in another fixed matrix.

◆ ApplyTo() [8/9]

template<class _containerType>
template<stride_type __stride, class __dataPtrType>
vctFixedSizeVector< value_type, DIMENSION > vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > & input) const
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.

Parameters
inputThe input vector
Returns
The output vector

◆ ApplyTo() [9/9]

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1, stride_type __stride2, class __dataPtrType2>
void vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > & input,
vctFixedSizeVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > & output ) const
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.

Parameters
inputThe input vector
outputThe output vector

◆ From() [1/6]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::From ( const ThisType & otherRotation)
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

◆ From() [2/6]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::From ( const vctAxisAngleRotation3< value_type > axisAngleRotation)
inline

Conversion from axis/angle.

◆ From() [3/6]

template<class _containerType>
template<stride_type __stride, class __dataPtrType>
CISST_DEPRECATED const ThisType & vctQuaternionRotation3Base< _containerType >::From ( const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > & axis,
const AngleType & 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).

Parameters
axisA unit vector of size 3.
angleThe angle in radian
Note
This method is deprecated. Use From(vctAxisAngleRotation3) instead.

◆ From() [4/6]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::From ( const vctMatrixRotation3Base< __containerType > & matrixRotation)
inline

Conversion from a rotation matrix.

◆ From() [5/6]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::From ( const vctRodriguezRotation3Base< __containerType > & rodriguezRotation)
inline

Conversion from a Rodriguez rotation.

◆ From() [6/6]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::From ( value_type x,
value_type y,
value_type z,
value_type r )
inline

Conversion from 4 numbers. This method actually performs an assignement and then check that the result is normalized.

◆ FromNormalized() [1/5]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromNormalized ( const vctAxisAngleRotation3< value_type > axisAngleRotation)
inline

Conversion from axis/angle.

◆ FromNormalized() [2/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromNormalized ( const vctMatrixRotation3Base< __containerType > & matrixRotation)
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).

◆ FromNormalized() [3/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromNormalized ( const vctQuaternionRotation3Base< __containerType > & other)
inline

Conversion from another quaternion. This method actually performs an assignement and then normalize the quaternion (this).

◆ FromNormalized() [4/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromNormalized ( const vctRodriguezRotation3Base< __containerType > & rodriguezRotation)
inline

Conversion from a Rodriguez rotation.

◆ FromNormalized() [5/5]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromNormalized ( value_type x,
value_type y,
value_type z,
value_type r )
inline

Conversion from 4 numbers. This method actually performs an assignement and then normalize the quaternion (this).

◆ FromRaw() [1/5]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctAxisAngleRotation3< value_type > axisAngleRotation)
inline

◆ FromRaw() [2/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctMatrixRotation3Base< __containerType > & matrixRotation)
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.

Parameters
matrixRotationA rotation matrix

◆ FromRaw() [3/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctQuaternionRotation3Base< __containerType > & other)
inline

◆ FromRaw() [4/5]

template<class _containerType>
template<class __containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctRodriguezRotation3Base< __containerType > & rodriguezRotation)
inline

Conversion from a Rodriguez rotation.

◆ FromRaw() [5/5]

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::FromRaw ( value_type x,
value_type y,
value_type z,
value_type r )
inline

◆ GetAxisAngle()

template<class _containerType>
template<stride_type __stride, class __dataPtrType>
CISST_DEPRECATED void vctQuaternionRotation3Base< _containerType >::GetAxisAngle ( vctFixedSizeVectorBase< 3, __stride, value_type, __dataPtrType > & axis,
value_type & angle )
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.

Parameters
rodriguezRotationthe Rodriguez rotation
Note
For reasons of numerical stability, if the magnitude of the Rodriguez vector is less than cmnTypeTraits<value_type>::Tolerance(), it is regarded as zero.
This method is deprecated. Use From(vctRodriguezRotation3Base) instead. */ template <stride_type __stride, class __dataPtrType> inline CISST_DEPRECATED const ThisType & From(const vctFixedSizeConstVectorBase<3, __stride, value_type, __dataPtrType> & rodriguezRotation) { const value_type axisLength = rodriguezRotation.Norm(); const value_type axisTolerance = cmnTypeTraits<value_type>::Tolerance(); const double angle = (fabs(axisLength) < axisTolerance) ? 0.0 : axisLength; const vctFixedSizeVector<value_type,3> defaultAxis(value_type(1), value_type(0), value_type(0)); const vctFixedSizeVector<value_type,3> axis( (angle == value_type(0)) ? defaultAxis : (rodriguezRotation / axisLength) ); return this->From(axis, angle); }

/*! 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.

Parameters
axisThe axis of the rotation
angleThe angle around the axis to match the rotation
Note
This method is deprecated. Use vctAxisAngleRotation3.From() instead.

◆ Identity()

template<class _containerType>
CISST_EXPORT const ThisType & vctQuaternionRotation3Base< _containerType >::Identity ( )
static

Const reference to the identity. In this case, (0, 0, 0, 1)

◆ Inverse()

template<class _containerType>
ThisType vctQuaternionRotation3Base< _containerType >::Inverse ( void ) const
inline

Create and return by copy the inverse of this matrix. This method is not the most efficient since it requires a copy.

◆ InverseOf()

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::InverseOf ( const ThisType & otherRotation)
inline

Set this rotation as the inverse of another one.

◆ InverseSelf()

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::InverseSelf ( void )
inline

Inverse this rotation quaternion. This methods assumes that the quaternion is normalized and sets this unit quaternion as its transposed.

◆ Normalized()

template<class _containerType>
ThisType vctQuaternionRotation3Base< _containerType >::Normalized ( void ) const
inline

Returns the normalized version of this quaternion rotation. This method returns a copy of the normalized version and does not modify this quaternion.

◆ NormalizedOf()

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::NormalizedOf ( const ThisType & otherQuaternion)
inline

Sets this rotation quaternion as the normalized version of another one.

Parameters
otherQuaternionrotation quaternion used to compute the normalized quaternion.

◆ NormalizedSelf()

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::NormalizedSelf ( void )
inline

Normalizes this quaternion rotation.

◆ operator*()

template<class _containerType>
ThisType vctQuaternionRotation3Base< _containerType >::operator* ( const ThisType & input) const
inline

Multiply two rotation quaternions and return the result as a normalized rotation quaternion.

Returns
(*this) * other
Note
this function overrides and shadows the operator * defined for basic quaternion type. The latter returns a vctQuaternion, while this version returns a specialized vctQuaternionRotation3Base

◆ operator=()

template<class _containerType>
ThisType & vctQuaternionRotation3Base< _containerType >::operator= ( const ThisType & quaternionRotation)
inline

◆ ThrowUnlessIsNormalized() [1/2]

template<class _containerType>
template<class _inputType>
void vctQuaternionRotation3Base< _containerType >::ThrowUnlessIsNormalized ( const _inputType & input) const
inlineprotected

Throw an exception unless the input is normalized.

Parameters
inputAn object with IsNormalized method.

◆ ThrowUnlessIsNormalized() [2/2]

template<class _containerType>
void vctQuaternionRotation3Base< _containerType >::ThrowUnlessIsNormalized ( void ) const
inlineprotected

Throw an exception unless this rotation is normalized.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

template<class _containerType>
vctQuaternionRotation3Base< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( typename ContainerType::value_type )

The documentation for this class was generated from the following files: