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
vctMatrixRotation2Base< _containerType > Class Template Reference

Define a rotation matrix for a space of dimension 2. More...

#include <vctForwardDeclarations.h>

Inheritance diagram for vctMatrixRotation2Base< _containerType >:

Public Types

enum  { ROWS = 2, COLS = 2 }
 
enum  { DIMENSION = 2 }
 
typedef _containerType BaseType
 
typedef _containerType ContainerType
 
typedef vctMatrixRotation2Base
< ContainerType
ThisType
 
typedef cmnTypeTraits< value_type > TypeTraits
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (typename ContainerType::value_type)
 
 vctMatrixRotation2Base ()
 
ThisTypeoperator= (const ContainerType &other)
 
ThisTypeoperator= (const ThisType &other)
 
 vctMatrixRotation2Base (const ThisType &other)
 
 vctMatrixRotation2Base (const BaseType &other)
 
template<stride_type __rowStride, stride_type __colStride, class __dataPtrType >
 vctMatrixRotation2Base (const vctFixedSizeMatrixBase< ROWS, COLS, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
 
CISST_EXPORT ThisTypeNormalizedSelf (void)
 
ThisTypeNormalizedOf (const ThisType &otherMatrix)
 
ThisType Normalized (void) const
 
bool IsNormalized (value_type tolerance=TypeTraits::Tolerance()) 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<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type, 2 > ApplyTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) 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<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type, 2 > ApplyInverseTo (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) 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
 
ThisType operator* (const ThisType &input) const
 
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector< value_type, 2 > operator* (const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &input) const
 
bool AlmostEquivalent (const ThisType &other, value_type tolerance=TypeTraits::Tolerance()) 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.
 vctMatrixRotation2Base (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11) throw (std::runtime_error)
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
 vctMatrixRotation2Base (const vctFixedSizeConstVectorBase< 2, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< 2, __stride2, value_type, __dataPtrType2 > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
 vctMatrixRotation2Base (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
 vctMatrixRotation2Base (const vctAngleRotation2 &angleRotation) 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.

 vctMatrixRotation2Base (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11, bool normalizeInput)
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
 vctMatrixRotation2Base (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, bool vectorsAreColumns, bool normalizeInput)
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
 vctMatrixRotation2Base (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns, bool normalizeInput)
 
 vctMatrixRotation2Base (const vctAngleRotation2 &angleRotation, 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 (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11) throw (std::runtime_error)
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisTypeFrom (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisTypeFrom (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
ThisTypeFrom (const vctAngleRotation2 &angleRotation) 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.

ThisTypeFromNormalized (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11)
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisTypeFromNormalized (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisTypeFromNormalized (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true)
 
ThisTypeFromNormalized (const vctAngleRotation2 &angleRotation)
 
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.

ThisTypeFromRaw (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11)
 
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisTypeFromRaw (const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &v1, const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &v2, bool vectorsAreColumns=true)
 
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisTypeFromRaw (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true) throw (std::runtime_error)
 
CISST_EXPORT ThisTypeFromRaw (const vctAngleRotation2 &angleRotation)
 
ThisTypeFromRaw (const ThisType &otherRotation)
 
template<stride_type __rowStride, stride_type __colStride, class __dataPtrType >
ThisTypeFromRaw (const vctFixedSizeMatrixBase< DIMENSION, DIMENSION, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
 

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)
 

Detailed Description

template<class _containerType>
class vctMatrixRotation2Base< _containerType >

Define a rotation matrix for a space of dimension 2.

This class is templated by the type of container used to store the rotation matrix. This class is an internal class, i.e. it is not intended for the end-user. The class which should be used by most is vctMatRot2 (eventually vctMatrixRotation2<_elementType>).

The main goal of this meta rotation matrix class is to ease the interface with Python. For a native Python object, a matrix rotation can be defined based on a vctDynamicMatrix which is much easier to wrap than a vctFixedSizeMatrix. For a C++ object accessed from Python, the rotation matrix will be defined using vctMatrixRotation2Base<vctDynamicMatrixRef<double> >, referring to the C++ vctMatrixRotation2Base<vctFixedSizeMatrix<double, 2, 2> >.

Parameters
_containerTypeThe type of the matrix.
See Also
vctFixedSizeMatrix

Member Typedef Documentation

template<class _containerType>
typedef _containerType vctMatrixRotation2Base< _containerType >::BaseType
template<class _containerType>
typedef _containerType vctMatrixRotation2Base< _containerType >::ContainerType
template<class _containerType>
typedef vctMatrixRotation2Base<ContainerType> vctMatrixRotation2Base< _containerType >::ThisType
template<class _containerType>
typedef cmnTypeTraits<value_type> vctMatrixRotation2Base< _containerType >::TypeTraits

Traits used for all useful types and values related to the element type.

Member Enumeration Documentation

template<class _containerType>
anonymous enum
Enumerator
ROWS 
COLS 
template<class _containerType>
anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( )
inline

Default constructor. Sets the rotation matrix to identity.

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const ThisType other)
inline
template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const BaseType other)
inline
template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const value_type &  element00,
const value_type &  element01,
const value_type &  element10,
const value_type &  element11 
)
throw (std::runtime_error
)
inline

Constructor from 4 elements.

The parameters are given row first so that the code remains human readable:

vctMatrixRotation2<double> matrix( 0.0, 1.0,
-1.0, 0.0);
template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctFixedSizeConstVectorBase< 2, __stride1, value_type, __dataPtrType1 > &  v1,
const vctFixedSizeConstVectorBase< 2, __stride2, value_type, __dataPtrType2 > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Constructor from 2 fixed size vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  v1,
const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Constructor from 2 dynamic vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctAngleRotation2 angleRotation)
throw (std::runtime_error
)
inline

Construction from a vctAngleRotation2.

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const value_type &  element00,
const value_type &  element01,
const value_type &  element10,
const value_type &  element11,
bool  normalizeInput 
)
inline

Constructor from 4 elements.

The parameters are given row first so that the code remains human readable:

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  v1,
const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  v2,
bool  vectorsAreColumns,
bool  normalizeInput 
)
inline

Constructor from 2 fixed size vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  v1,
const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &  v2,
bool  vectorsAreColumns,
bool  normalizeInput 
)
inline

Constructor from 2 dynamic vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctAngleRotation2 angleRotation,
bool  normalizeInput 
)
inline

Construction from a vctAngleRotation2.

template<class _containerType>
template<stride_type __rowStride, stride_type __colStride, class __dataPtrType >
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const vctFixedSizeMatrixBase< ROWS, COLS, __rowStride, __colStride, value_type, __dataPtrType > &  matrix)
inlineexplicit

Initialize this rotation matrix with a base matrix. This constructor only takes a matrix of the same element type.

Note
This constructor does not verify normalization. It is introduced to allow using results of matrix operations and assign them to a rotation matrix.
The constructor is declared explicit, to force the user to be aware of the conversion being made.

Member Function Documentation

template<class _containerType>
void vctMatrixRotation2Base< _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 vctMatrixRotation2Base< _containerType >::AlmostEquivalent ( const ThisType other,
value_type  tolerance = TypeTraits::Tolerance() 
) const
inline

Return true if this rotation is effectively equivalent to the other rotation, up to the given tolerance. For a rotation matrix, this method is strictly the same as AlmostEqual.

See Also
AlmostEqual
template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void vctMatrixRotation2Base< _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 2 provided by the caller and passed by reference.
Parameters
inputThe input vector
outputThe output vector
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, 2> vctMatrixRotation2Base< _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 2. 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>
void vctMatrixRotation2Base< _containerType >::ApplyInverseTo ( const ThisType input,
ThisType output 
) const
inline

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

Parameters
inputThe input rotation
outputThe output rotation
template<class _containerType>
ThisType vctMatrixRotation2Base< _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 vctMatrixRotation2Base< _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 2.

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
void vctMatrixRotation2Base< _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 2. The result is stored into another vector of size 2 provided by the caller and passed by reference.

Parameters
inputThe input vector
outputThe output vector
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, 2> vctMatrixRotation2Base< _containerType >::ApplyTo ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  input) const
inline

Apply the rotation to a vector of fixed size 2. 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>
void vctMatrixRotation2Base< _containerType >::ApplyTo ( const ThisType input,
ThisType output 
) const
inline

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

Parameters
inputThe input rotation
outputThe output rotation
template<class _containerType>
ThisType vctMatrixRotation2Base< _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 vctMatrixRotation2Base< _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 2.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::From ( const value_type &  element00,
const value_type &  element01,
const value_type &  element10,
const value_type &  element11 
)
throw (std::runtime_error
)
inline

Conversion from 4 elements.

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisType& vctMatrixRotation2Base< _containerType >::From ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  v1,
const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Conversion from 2 fixed size vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisType& vctMatrixRotation2Base< _containerType >::From ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  v1,
const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Conversion from 2 dynamic vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::From ( const vctAngleRotation2 angleRotation)
throw (std::runtime_error
)
inline

Conversion from an angle rotation.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::FromNormalized ( const value_type &  element00,
const value_type &  element01,
const value_type &  element10,
const value_type &  element11 
)
inline

Conversion from 4 elements.

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisType& vctMatrixRotation2Base< _containerType >::FromNormalized ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  v1,
const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Conversion from 2 fixed size vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisType& vctMatrixRotation2Base< _containerType >::FromNormalized ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  v1,
const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &  v2,
bool  vectorsAreColumns = true 
)
inline

Conversion from 2 dynamic vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::FromNormalized ( const vctAngleRotation2 angleRotation)
inline

Conversion from an angle rotation.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const value_type &  element00,
const value_type &  element01,
const value_type &  element10,
const value_type &  element11 
)
inline

Conversion from 4 elements.

template<class _containerType>
template<stride_type __stride1, class __dataPtrType1 , stride_type __stride2, class __dataPtrType2 >
ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const vctFixedSizeConstVectorBase< DIMENSION, __stride1, value_type, __dataPtrType1 > &  v1,
const vctFixedSizeConstVectorBase< DIMENSION, __stride2, value_type, __dataPtrType2 > &  v2,
bool  vectorsAreColumns = true 
)
inline

Conversion from 2 fixed size vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
template<class __vectorOwnerType1 , class __vectorOwnerType2 >
ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &  v1,
const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &  v2,
bool  vectorsAreColumns = true 
)
throw (std::runtime_error
)
inline

Conversion from 2 dynamic vectors.

By default the vectors represents the columns of the matrix. If the parameter vectorsAreColumns is set to false, the vectors provided will be used to set the matrix row by row.

template<class _containerType>
CISST_EXPORT ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const vctAngleRotation2 angleRotation)

Conversion from an angle rotation

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const ThisType otherRotation)
inline

A complementary form of assigning one matrix 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 __rowStride, stride_type __colStride, class __dataPtrType >
ThisType& vctMatrixRotation2Base< _containerType >::FromRaw ( const vctFixedSizeMatrixBase< DIMENSION, DIMENSION, __rowStride, __colStride, value_type, __dataPtrType > &  matrix)
inline

Assign a 2x2 matrix to this rotation matrix. This method does not substitute the Assign() method. Assign() may perform type conversion, while From() only takes a matrix of the same element type.

Note
This method does not verify normalization. It is introduced to allow using results of matrix operations and assign them to a rotation matrix.
template<class _containerType>
static CISST_EXPORT const ThisType& vctMatrixRotation2Base< _containerType >::Identity ( )
static

Const reference to the identity. In this case, the identity matrix:

1 0
0 1
template<class _containerType>
ThisType vctMatrixRotation2Base< _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. See also InverseSelf().

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

Set this rotation as the inverse of another one. See also InverseSelf().

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

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

template<class _containerType>
bool vctMatrixRotation2Base< _containerType >::IsNormalized ( value_type  tolerance = TypeTraits::Tolerance()) const
inline

Test if this matrix is normalized. This methods checks that all the columns are normalized (within a margin of tolerance) and then checks that the two vectors are orthogonal to each other.

Parameters
toleranceTolerance for the norm and scalar product tests.
template<class _containerType>
ThisType vctMatrixRotation2Base< _containerType >::Normalized ( void  ) const
inline

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

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::NormalizedOf ( const ThisType otherMatrix)
inline

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

Parameters
otherMatrixMatrix used to compute the normalized matrix.
template<class _containerType>
CISST_EXPORT ThisType& vctMatrixRotation2Base< _containerType >::NormalizedSelf ( void  )

Normalizes this matrix. This method converts the matrix to an angle and convert back to a matrix.

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

Multiply two rotation matrices and return the result as a rotation matrix.

Returns
(*this) * other
Note
this function overrides and shadows the operator * defined for basic matrix type. The latter returns a vctFixedSizeMatrix, while this version returns a specialized rotation matrix.
template<class _containerType>
template<stride_type __stride, class __dataPtrType >
vctFixedSizeVector<value_type, 2> vctMatrixRotation2Base< _containerType >::operator* ( const vctFixedSizeConstVectorBase< DIMENSION, __stride, value_type, __dataPtrType > &  input) const
inline

Override the * operator defined in the matrix base for matrix * vector. This prevents compiler confusion between the overloaded RotMat*RotMat and the base-class Mat*Vec

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::operator= ( const ContainerType other)
inline

The assignment from BaseType (i.e. a 2 by 2 fixed size matrix) has to be redefined for this class (C++ restriction). This operator uses the Assign() method inherited from the BaseType. This operator (as well as the Assign method) allows to set a rotation matrix to whatever value without any further validity checking. It is recommended to use it with caution.

template<class _containerType>
ThisType& vctMatrixRotation2Base< _containerType >::operator= ( const ThisType other)
inline
template<class _containerType>
void vctMatrixRotation2Base< _containerType >::ThrowUnlessIsNormalized ( void  ) const
throw (std::runtime_error
)
inlineprotected

Throw an exception unless this rotation is normalized.

template<class _containerType>
template<class _inputType >
void vctMatrixRotation2Base< _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>
vctMatrixRotation2Base< _containerType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( typename ContainerType::value_type  )

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