cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vctQuaternionRotation3Base< _containerType > Class Template Reference

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

#include <vctForwardDeclarations.h>

Inheritance diagram for vctQuaternionRotation3Base< _containerType >:
vctQuaternionBase< _containerType >

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)
 
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,
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
 
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) throw (std::runtime_error)
 
template<class __containerType >
 vctQuaternionRotation3Base (const vctMatrixRotation3Base< __containerType > &matrixRotation) throw (std::runtime_error)
 
 vctQuaternionRotation3Base (const vctAxisAngleRotation3< value_type > &axisAngleRotation) throw (std::runtime_error)
 
template<class __containerType >
 vctQuaternionRotation3Base (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) throw (std::runtime_error)
 
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)
 
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) throw (std::runtime_error)
 
ThisTypeFrom (const vctAxisAngleRotation3< value_type > axisAngleRotation) throw (std::runtime_error)
 
template<class __containerType >
ThisTypeFrom (const vctRodriguezRotation3Base< __containerType > &rodriguezRotation) throw (std::runtime_error)
 
template<class __containerType >
ThisTypeFrom (const vctMatrixRotation3Base< __containerType > &matrixRotation) throw (std::runtime_error)
 
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)
 
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 const ThisTypeFrom (const vctFixedSizeConstVectorBase< 3, __stride, value_type, __dataPtrType > &rodriguezRotation)
 
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)
 

Static Public Member Functions

static CISST_EXPORT const
ThisType
Identity ()
 

Protected Member Functions

void ThrowUnlessIsNormalized (void) const throw (std::runtime_error)
 
template<class _inputType >
void ThrowUnlessIsNormalized (const _inputType &input) const throw (std::runtime_error)
 
void Allocate (void)
 
- Protected Member Functions inherited from vctQuaternionBase< _containerType >
void Allocate (void)
 
template<>
void Allocate (void)
 
template<>
void Allocate (void)
 

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

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

Type of base class.

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.

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

Member Enumeration Documentation

template<class _containerType>
anonymous enum
Enumerator
SIZE 
template<class _containerType>
anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

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

Default constructor. Sets the rotation quaternion to identity.

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

Copy constructor.

Parameters
quaternionRotationA rotation quaternion.
template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const value_type &  x,
const value_type &  y,
const value_type &  z,
const value_type &  r 
)
throw (std::runtime_error
)
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.
template<class _containerType>
template<class __containerType >
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctMatrixRotation3Base< __containerType > &  matrixRotation)
throw (std::runtime_error
)
inlineexplicit

Constructor from a rotation matrix.

Parameters
matrixRotationA rotation matrix.
template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctAxisAngleRotation3< value_type > &  axisAngleRotation)
throw (std::runtime_error
)
inline

Constructor from an axis and angle.

Parameters
axisAngleRotationAn axis/angle rotation.
template<class _containerType>
template<class __containerType >
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const vctRodriguezRotation3Base< __containerType > &  rodriguezRotation)
throw (std::runtime_error
)
inline

Constructor from a Rodriguez rotation.

Parameters
rodriguezRotationA Rodriguez rotation.
template<class _containerType>
vctQuaternionRotation3Base< _containerType >::vctQuaternionRotation3Base ( const ThisType quaternionRotation,
bool  normalizeInput 
)
inline

Copy constructor.

Parameters
quaternionRotationA rotation quaternion.
normalizeInputForce the input normalization.
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.
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.
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.
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

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.

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
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
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
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
template<class _containerType>
template<class __vectorOwnerType >
vctFixedSizeVector<value_type, DIMENSION> vctQuaternionRotation3Base< _containerType >::ApplyInverseTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input) const
inline
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.

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
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
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.

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.

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
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
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
template<class _containerType>
template<class __vectorOwnerType >
vctFixedSizeVector<value_type, DIMENSION> vctQuaternionRotation3Base< _containerType >::ApplyTo ( const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &  input) const
inline
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.

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.

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
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
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.

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

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

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

Conversion from axis/angle.

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

Conversion from a Rodriguez rotation.

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

Conversion from a rotation matrix.

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

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

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).

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

Conversion from axis/angle.

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

Conversion from a Rodriguez rotation.

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).

template<class _containerType>
template<class __containerType >
ThisType& vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctQuaternionRotation3Base< __containerType > &  other)
inline
template<class _containerType>
ThisType& vctQuaternionRotation3Base< _containerType >::FromRaw ( value_type  x,
value_type  y,
value_type  z,
value_type  r 
)
inline
template<class _containerType>
ThisType& vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctAxisAngleRotation3< value_type >  axisAngleRotation)
inline
template<class _containerType>
template<class __containerType >
ThisType& vctQuaternionRotation3Base< _containerType >::FromRaw ( const vctRodriguezRotation3Base< __containerType > &  rodriguezRotation)
inline

Conversion from a Rodriguez rotation.

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
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 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.
template<class _containerType>
static CISST_EXPORT const ThisType& vctQuaternionRotation3Base< _containerType >::Identity ( )
static

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

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.

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

Set this rotation as the inverse of another one.

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.

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.

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.
template<class _containerType>
ThisType& vctQuaternionRotation3Base< _containerType >::NormalizedSelf ( void  )
inline

Normalizes this quaternion rotation.

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
template<class _containerType>
void vctQuaternionRotation3Base< _containerType >::ThrowUnlessIsNormalized ( void  ) const
throw (std::runtime_error
)
inlineprotected

Throw an exception unless this rotation is normalized.

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

Throw an exception unless the input is normalized.

Parameters
inputAn object with IsNormalized method.
template<class _containerType>
vctQuaternionRotation3Base< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( typename ContainerType::value_type  )

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