Rotation2D< _Scalar > Class Template Reference
[Geometry_Module]

Represents a rotation/orientation in a 2 dimensional space. More...

#include <Rotation2D.h>

Inheritance diagram for Rotation2D< _Scalar >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { Dim = 2 }
typedef Matrix< Scalar, 2, 2 > Matrix2
typedef _Scalar Scalar
typedef Matrix< Scalar, 2, 1 > Vector2

Public Member Functions

Scalarangle ()
Scalar angle () const
template<typename NewScalarType >
ei_cast_return_type
< Rotation2D, Rotation2D
< NewScalarType > >::type 
cast () const
template<typename Derived >
Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
Rotation2D inverse () const
bool isApprox (const Rotation2D &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
Vector2 operator* (const Vector2 &vec) const
Rotation2D operator* (const Rotation2D &other) const
Rotation2Doperator*= (const Rotation2D &other)
template<typename OtherScalarType >
 Rotation2D (const Rotation2D< OtherScalarType > &other)
 Rotation2D (Scalar a)
Rotation2D slerp (Scalar t, const Rotation2D &other) const
Matrix2 toRotationMatrix (void) const

Protected Attributes

Scalar m_angle

Private Types

typedef RotationBase
< Rotation2D< _Scalar >, 2 > 
Base

Detailed Description

template<typename _Scalar>
class Rotation2D< _Scalar >

Represents a rotation/orientation in a 2 dimensional space.

Parameters:
_Scalar the scalar type, i.e., the type of the coefficients

This class is equivalent to a single scalar representing a counter clock wise rotation as a single angle in radian. It provides some additional features such as the automatic conversion from/to a 2x2 rotation matrix. Moreover this class aims to provide a similar interface to Quaternion in order to facilitate the writing of generic algorithms dealing with rotations.

See also:
class Quaternion, class Transform

Definition at line 50 of file Rotation2D.h.


Member Typedef Documentation

template<typename _Scalar>
typedef RotationBase<Rotation2D<_Scalar>,2> Rotation2D< _Scalar >::Base [private]

Definition at line 52 of file Rotation2D.h.

template<typename _Scalar>
typedef Matrix<Scalar,2,2> Rotation2D< _Scalar >::Matrix2

Definition at line 62 of file Rotation2D.h.

template<typename _Scalar>
typedef _Scalar Rotation2D< _Scalar >::Scalar

the scalar type of the coefficients

Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.

Definition at line 60 of file Rotation2D.h.

template<typename _Scalar>
typedef Matrix<Scalar,2,1> Rotation2D< _Scalar >::Vector2

Definition at line 61 of file Rotation2D.h.


Member Enumeration Documentation

template<typename _Scalar>
anonymous enum
Enumerator:
Dim 

Definition at line 58 of file Rotation2D.h.


Constructor & Destructor Documentation

template<typename _Scalar>
Rotation2D< _Scalar >::Rotation2D ( Scalar  a  )  [inline]

Construct a 2D counter clock wise rotation from the angle a in radian.

Definition at line 71 of file Rotation2D.h.

template<typename _Scalar>
template<typename OtherScalarType >
Rotation2D< _Scalar >::Rotation2D ( const Rotation2D< OtherScalarType > &  other  )  [inline, explicit]

Copy constructor with scalar type conversion

Definition at line 115 of file Rotation2D.h.


Member Function Documentation

template<typename _Scalar>
Scalar& Rotation2D< _Scalar >::angle (  )  [inline]
Returns:
a read-write reference to the rotation angle

Definition at line 77 of file Rotation2D.h.

template<typename _Scalar>
Scalar Rotation2D< _Scalar >::angle (  )  const [inline]
Returns:
the rotation angle

Definition at line 74 of file Rotation2D.h.

template<typename _Scalar>
template<typename NewScalarType >
ei_cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type Rotation2D< _Scalar >::cast (  )  const [inline]
Returns:
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

Definition at line 110 of file Rotation2D.h.

template<typename Scalar >
template<typename Derived >
Rotation2D< Scalar > & Rotation2D< Scalar >::fromRotationMatrix ( const MatrixBase< Derived > &  mat  )  [inline]

Set *this from a 2x2 rotation matrix mat. In other words, this function extract the rotation angle from the rotation matrix.

Definition at line 141 of file Rotation2D.h.

template<typename _Scalar>
Rotation2D Rotation2D< _Scalar >::inverse ( void   )  const [inline]
Returns:
the inverse rotation

Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.

Definition at line 80 of file Rotation2D.h.

template<typename _Scalar>
bool Rotation2D< _Scalar >::isApprox ( const Rotation2D< _Scalar > &  other,
typename NumTraits< Scalar >::Real  prec = precision<Scalar>() 
) const [inline]
Returns:
true if *this is approximately equal to other, within the precision determined by prec.
See also:
MatrixBase::isApprox()

Definition at line 124 of file Rotation2D.h.

template<typename _Scalar>
Vector2 Rotation2D< _Scalar >::operator* ( const Vector2 vec  )  const [inline]

Applies the rotation to a 2D vector

Definition at line 91 of file Rotation2D.h.

template<typename _Scalar>
Rotation2D Rotation2D< _Scalar >::operator* ( const Rotation2D< _Scalar > &  other  )  const [inline]

Concatenates two rotations

Definition at line 83 of file Rotation2D.h.

template<typename _Scalar>
Rotation2D& Rotation2D< _Scalar >::operator*= ( const Rotation2D< _Scalar > &  other  )  [inline]

Concatenates two rotations

Definition at line 87 of file Rotation2D.h.

template<typename _Scalar>
Rotation2D Rotation2D< _Scalar >::slerp ( Scalar  t,
const Rotation2D< _Scalar > &  other 
) const [inline]
Returns:
the spherical interpolation between *this and other using parameter t. It is in fact equivalent to a linear interpolation.

Definition at line 101 of file Rotation2D.h.

template<typename Scalar >
Rotation2D< Scalar >::Matrix2 Rotation2D< Scalar >::toRotationMatrix ( void   )  const [inline]

Constructs and

Returns:
an equivalent 2x2 rotation matrix.

Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.

Definition at line 152 of file Rotation2D.h.


Member Data Documentation

template<typename _Scalar>
Scalar Rotation2D< _Scalar >::m_angle [protected]

Definition at line 66 of file Rotation2D.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:22:20 2013