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

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

#include <vctMatrixRotation2Base.h>

Inheritance diagram for vctMatrixRotation2Base< _containerType >:
vctMatrixRotation2< value_type > vctMatrixRotation2< double > vctMatrixRotation2< float >

Public Types

enum  { ROWS = 2 , COLS = 2 }
enum  { DIMENSION = 2 }
typedef _containerType BaseType
typedef _containerType ContainerType
typedef vctMatrixRotation2Base< ContainerTypeThisType
typedef cmnTypeTraits< value_typeTypeTraits

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)
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) CISST_THROW(std
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) CISST_THROW(std
template<class __vectorOwnerType1, class __vectorOwnerType2>
 vctMatrixRotation2Base (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true) CISST_THROW(std
 vctMatrixRotation2Base (const vctAngleRotation2 &angleRotation) 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 (const value_type &element00, const value_type &element01, const value_type &element10, const value_type &element11) CISST_THROW(std
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) CISST_THROW(std
template<class __vectorOwnerType1, class __vectorOwnerType2>
ThisTypeFrom (const vctDynamicConstVectorBase< __vectorOwnerType1, value_type > &v1, const vctDynamicConstVectorBase< __vectorOwnerType2, value_type > &v2, bool vectorsAreColumns=true) CISST_THROW(std
ThisTypeFrom (const vctAngleRotation2 &angleRotation) 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.

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) CISST_THROW(std
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) CISST_THROW(std
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)
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

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)

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)
template<stride_type __rowStride, stride_type __colStride, class __dataPtrType>
 vctMatrixRotation2Base (const vctFixedSizeMatrixBase< ROWS, COLS, __rowStride, __colStride, value_type, __dataPtrType > &matrix)
static CISST_EXPORT const ThisTypeIdentity ()

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

◆ BaseType

template<class _containerType>
typedef _containerType vctMatrixRotation2Base< _containerType >::BaseType

◆ ContainerType

template<class _containerType>
typedef _containerType vctMatrixRotation2Base< _containerType >::ContainerType

◆ ThisType

template<class _containerType>
typedef vctMatrixRotation2Base<ContainerType> vctMatrixRotation2Base< _containerType >::ThisType

◆ TypeTraits

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

◆ anonymous enum

template<class _containerType>
anonymous enum
Enumerator
DIMENSION 

◆ anonymous enum

template<class _containerType>
anonymous enum
Enumerator
ROWS 
COLS 

Constructor & Destructor Documentation

◆ vctMatrixRotation2Base() [1/12]

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

Default constructor. Sets the rotation matrix to identity.

◆ vctMatrixRotation2Base() [2/12]

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

◆ vctMatrixRotation2Base() [3/12]

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const BaseType & other)
inline

◆ vctMatrixRotation2Base() [4/12]

template<class _containerType>
vctMatrixRotation2Base< _containerType >::vctMatrixRotation2Base ( const value_type & element00,
const value_type & element01,
const value_type & element10,
const value_type & element11 )
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);
Define a rotation matrix for a space of dimension 2.
Definition vctMatrixRotation2.h:49

◆ vctMatrixRotation2Base() [5/12]

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

◆ vctMatrixRotation2Base() [6/12]

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

◆ vctMatrixRotation2Base() [7/12]

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

Construction from a vctAngleRotation2.

◆ vctMatrixRotation2Base() [8/12]

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:

-1.0, 0.0);
vctMatrixRotation2Base()
Definition vctMatrixRotation2Base.h:102

◆ vctMatrixRotation2Base() [9/12]

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.

◆ vctMatrixRotation2Base() [10/12]

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.

◆ vctMatrixRotation2Base() [11/12]

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

Construction from a vctAngleRotation2.

◆ vctMatrixRotation2Base() [12/12]

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

◆ Allocate()

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.

◆ AlmostEquivalent()

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

◆ ApplyInverseTo() [1/5]

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

◆ ApplyInverseTo() [2/5]

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

◆ ApplyInverseTo() [3/5]

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.

◆ ApplyInverseTo() [4/5]

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

◆ ApplyInverseTo() [5/5]

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

◆ ApplyTo() [1/5]

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

◆ ApplyTo() [2/5]

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

◆ ApplyTo() [3/5]

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.

◆ ApplyTo() [4/5]

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

◆ ApplyTo() [5/5]

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

◆ From() [1/4]

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

Conversion from 4 elements.

◆ From() [2/4]

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

Conversion from an angle rotation.

◆ From() [3/4]

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

◆ From() [4/4]

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

◆ FromNormalized() [1/4]

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.

◆ FromNormalized() [2/4]

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

Conversion from an angle rotation.

◆ FromNormalized() [3/4]

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.

◆ FromNormalized() [4/4]

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

◆ FromRaw() [1/6]

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

◆ FromRaw() [2/6]

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.

◆ FromRaw() [3/6]

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

Conversion from an angle rotation

◆ FromRaw() [4/6]

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

◆ FromRaw() [5/6]

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.

◆ FromRaw() [6/6]

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.

◆ Identity()

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

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

1 0
0 1

◆ Inverse()

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

◆ InverseOf()

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

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

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

◆ IsNormalized()

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.

◆ Normalized()

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.

◆ NormalizedOf()

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.

◆ NormalizedSelf()

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.

◆ operator*() [1/2]

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.

◆ operator*() [2/2]

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

◆ operator=() [1/2]

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.

◆ operator=() [2/2]

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

◆ ThrowUnlessIsNormalized() [1/2]

template<class _containerType>
template<class _inputType>
void vctMatrixRotation2Base< _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 vctMatrixRotation2Base< _containerType >::ThrowUnlessIsNormalized ( void ) const
inlineprotected

Throw an exception unless this rotation is normalized.

◆ VCT_CONTAINER_TRAITS_TYPEDEFS()

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

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