Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Types
Eigen::Rotation2D Class Reference

Detailed Description

Represents a rotation/orientation in a 2 dimensional space.

Parameters:
_Scalarthe 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
Inheritance diagram for Eigen::Rotation2D:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { Dim = 2 }
typedef _Scalar Scalar
 the scalar type of the coefficients
typedef Matrix< Scalar, 2, 1 > Vector2
typedef Matrix< Scalar, 2, 2 > Matrix2

Public Member Functions

 Rotation2D (Scalar a)
 Construct a 2D counter clock wise rotation from the angle a in radian.
Scalar angle () const
Scalar & angle ()
Rotation2D inverse () const
Rotation2D operator* (const Rotation2D &other) const
 Concatenates two rotations.
Rotation2D & operator*= (const Rotation2D &other)
 Concatenates two rotations.
Vector2 operator* (const Vector2 &vec) const
 Applies the rotation to a 2D vector.
template<typename Derived >
Rotation2D & fromRotationMatrix (const MatrixBase< Derived > &m)
 Set *this from a 2x2 rotation matrix mat.
Matrix2 toRotationMatrix (void) const
 Constructs and.
Rotation2D slerp (Scalar t, const Rotation2D &other) const
template<typename NewScalarType >
internal::cast_return_type
< Rotation2D, Rotation2D
< NewScalarType > >::type 
cast () const
template<typename OtherScalarType >
 Rotation2D (const Rotation2D< OtherScalarType > &other)
 Copy constructor with scalar type conversion.
bool isApprox (const Rotation2D &other, typename NumTraits< Scalar >::Real prec=NumTraits< Scalar >::dummy_precision()) const

Static Public Member Functions

static Rotation2D Identity ()

Protected Attributes

Scalar m_angle

Private Types

typedef RotationBase
< Rotation2D< _Scalar >, 2 > 
Base

Member Typedef Documentation

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

Definition at line 57 of file Geometry.

Definition at line 67 of file Geometry.

typedef _Scalar Eigen::Rotation2D::Scalar

the scalar type of the coefficients

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

Definition at line 65 of file Geometry.

Definition at line 66 of file Geometry.


Member Enumeration Documentation

anonymous enum
Enumerator:
Dim 

Definition at line 63 of file Geometry.


Constructor & Destructor Documentation

Eigen::Rotation2D::Rotation2D ( Scalar  a) [inline]

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

Definition at line 76 of file Geometry.

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

Copy constructor with scalar type conversion.

Definition at line 120 of file Geometry.


Member Function Documentation

Scalar Eigen::Rotation2D::angle ( ) const [inline]
Returns:
the rotation angle

Definition at line 79 of file Geometry.

Scalar& Eigen::Rotation2D::angle ( ) [inline]
Returns:
a read-write reference to the rotation angle

Definition at line 82 of file Geometry.

template<typename NewScalarType >
internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type Eigen::Rotation2D::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 115 of file Geometry.

template<typename Derived >
Rotation2D< Scalar > & Eigen::Rotation2D::fromRotationMatrix ( const MatrixBase< Derived > &  mat)

Set *this from a 2x2 rotation matrix mat.

In other words, this function extract the rotation angle from the rotation matrix.

Definition at line 148 of file Geometry.

static Rotation2D Eigen::Rotation2D::Identity ( ) [inline, static]

Definition at line 125 of file Geometry.

Rotation2D Eigen::Rotation2D::inverse ( ) const [inline]
Returns:
the inverse rotation

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

Definition at line 85 of file Geometry.

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

Definition at line 131 of file Geometry.

Rotation2D Eigen::Rotation2D::operator* ( const Rotation2D &  other) const [inline]

Concatenates two rotations.

Definition at line 88 of file Geometry.

Vector2 Eigen::Rotation2D::operator* ( const Vector2 &  vec) const [inline]

Applies the rotation to a 2D vector.

Definition at line 96 of file Geometry.

Rotation2D& Eigen::Rotation2D::operator*= ( const Rotation2D &  other) [inline]

Concatenates two rotations.

Definition at line 92 of file Geometry.

Rotation2D Eigen::Rotation2D::slerp ( Scalar  t,
const Rotation2D &  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 106 of file Geometry.

Rotation2D< Scalar >::Matrix2 Eigen::Rotation2D::toRotationMatrix ( void  ) const

Constructs and.

Returns:
an equivalent 2x2 rotation matrix.

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

Definition at line 159 of file Geometry.


Member Data Documentation

Definition at line 71 of file Geometry.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011