Represents a rotation/orientation in a 2 dimensional space. More...
Public Types | |
enum | { Dim } |
typedef Matrix< Scalar, 2, 2 > | Matrix2 |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, 2, 1 > | Vector2 |
Public Member Functions | |
Scalar & | angle () |
Scalar | angle () const |
template<typename NewScalarType > | |
ei_cast_return_type < Rotation2D, Rotation2D < NewScalarType > >::type | cast () const |
template<typename Derived > | |
Rotation2D & | fromRotationMatrix (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 |
Rotation2D & | operator*= (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 |
Represents a rotation/orientation in a 2 dimensional space.
This is defined in the Geometry module.
#include <Eigen/Geometry>
_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.
typedef _Scalar Scalar |
the scalar type of the coefficients
Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.
Rotation2D | ( | Scalar | a | ) | [inline] |
Construct a 2D counter clock wise rotation from the angle a in radian.
Rotation2D | ( | const Rotation2D< OtherScalarType > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
Scalar& angle | ( | ) | [inline] |
Scalar angle | ( | ) | const [inline] |
ei_cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type cast | ( | ) | const [inline] |
*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 | ) | [inline] |
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] |
Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.
bool isApprox | ( | const Rotation2D< _Scalar > & | other, | |
typename NumTraits< Scalar >::Real | prec = precision<Scalar>() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Rotation2D operator* | ( | const Rotation2D< _Scalar > & | other | ) | const [inline] |
Concatenates two rotations
Rotation2D& operator*= | ( | const Rotation2D< _Scalar > & | other | ) | [inline] |
Concatenates two rotations
Rotation2D slerp | ( | Scalar | t, | |
const Rotation2D< _Scalar > & | other | |||
) | const [inline] |
*this
and other using parameter t. It is in fact equivalent to a linear interpolation. Rotation2D< Scalar >::Matrix2 toRotationMatrix | ( | void | ) | const [inline] |
Constructs and
Reimplemented from RotationBase< Rotation2D< _Scalar >, 2 >.