Public Types | Public Member Functions | List of all members
Rotation2D< Scalar > Class Template Reference

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

+ Inheritance diagram for Rotation2D< Scalar >:

Public Types

typedef _Scalar Scalar
 

Public Member Functions

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

Detailed Description

template<typename Scalar>
class Eigen::Rotation2D< Scalar >

Represents a rotation/orientation in a 2 dimensional space.

This is defined in the Geometry module.

#include <Eigen/Geometry>
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

Member Typedef Documentation

typedef _Scalar Scalar

the scalar type of the coefficients

Constructor & Destructor Documentation

Rotation2D ( Scalar  a)
inline

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

Rotation2D ( const Rotation2D< OtherScalarType > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

Scalar angle ( ) const
inline
Returns
the rotation angle
Scalar& angle ( )
inline
Returns
a read-write reference to the rotation angle
internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type 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.

Rotation2D<Scalar>& 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.

Rotation2D inverse ( ) const
inline
Returns
the inverse rotation
bool isApprox ( const Rotation2D< Scalar > &  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()
Rotation2D operator* ( const Rotation2D< Scalar > &  other) const
inline

Concatenates two rotations

Vector2 operator* ( const Vector2 vec) const
inline

Applies the rotation to a 2D vector

Rotation2D& operator*= ( const Rotation2D< Scalar > &  other)
inline

Concatenates two rotations

Rotation2D 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.
Rotation2D< Scalar >::Matrix2 toRotationMatrix ( void  ) const

Constructs and

Returns
an equivalent 2x2 rotation matrix.

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