Eigen  3.3.3
Eigen::Rotation2D< _Scalar > Class Template Reference

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> 
Template 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< _Scalar >:

List of all members.

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 >
Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
Rotation2D inverse () const
bool isApprox (const Rotation2D &other, const 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)
template<typename Derived >
Rotation2Doperator= (const MatrixBase< Derived > &m)
 Rotation2D (const Scalar &a)
 Rotation2D ()
template<typename Derived >
 Rotation2D (const MatrixBase< Derived > &m)
template<typename OtherScalarType >
 Rotation2D (const Rotation2D< OtherScalarType > &other)
Rotation2D slerp (const Scalar &t, const Rotation2D &other) const
Scalar smallestAngle () const
Scalar smallestPositiveAngle () const
Matrix2 toRotationMatrix () const

Member Typedef Documentation

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

the scalar type of the coefficients

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


Constructor & Destructor Documentation

template<typename _Scalar>
Eigen::Rotation2D< _Scalar >::Rotation2D ( const Scalar a) [inline, explicit]

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

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

Default constructor wihtout initialization. The represented rotation is undefined.

template<typename _Scalar>
template<typename Derived >
Eigen::Rotation2D< _Scalar >::Rotation2D ( const MatrixBase< Derived > &  m) [inline, explicit]

Construct a 2D rotation from a 2x2 rotation matrix mat.

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

Copy constructor with scalar type conversion


Member Function Documentation

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

template<typename Scalar >
template<typename Derived >
Rotation2D< Scalar > & Eigen::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.

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

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

template<typename _Scalar>
bool Eigen::Rotation2D< _Scalar >::isApprox ( const Rotation2D< _Scalar > &  other,
const 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()
template<typename _Scalar>
Rotation2D Eigen::Rotation2D< _Scalar >::operator* ( const Rotation2D< _Scalar > &  other) const [inline]

Concatenates two rotations

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

Applies the rotation to a 2D vector

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

Concatenates two rotations

template<typename _Scalar>
template<typename Derived >
Rotation2D& Eigen::Rotation2D< _Scalar >::operator= ( const MatrixBase< Derived > &  m) [inline]

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

This method is an alias for fromRotationMatrix()

See also:
fromRotationMatrix()
template<typename _Scalar>
Rotation2D Eigen::Rotation2D< _Scalar >::slerp ( const 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.
template<typename _Scalar>
Scalar Eigen::Rotation2D< _Scalar >::smallestAngle ( ) const [inline]
Returns:
the rotation angle in [-pi,pi]
template<typename _Scalar>
Scalar Eigen::Rotation2D< _Scalar >::smallestPositiveAngle ( ) const [inline]
Returns:
the rotation angle in [0,2pi]
template<typename Scalar >
Rotation2D< Scalar >::Matrix2 Eigen::Rotation2D< Scalar >::toRotationMatrix ( void  ) const

Constructs and

Returns:
an equivalent 2x2 rotation matrix.

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


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