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 |
![]() | |
enum | |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef ei_traits< Rotation2D < _Scalar > >::Scalar | Scalar |
Public Member Functions | |
Scalar | angle () const |
Scalar & | angle () |
template<typename NewScalarType > | |
ei_cast_return_type < Rotation2D, Rotation2D < NewScalarType > >::type | cast () const |
template<typename Derived > | |
Rotation2D & | fromRotationMatrix (const MatrixBase< Derived > &m) |
template<typename Derived > | |
Rotation2D< Scalar > & | fromRotationMatrix (const MatrixBase< Derived > &mat) |
Rotation2D | inverse () const |
bool | isApprox (const Rotation2D &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
Rotation2D | operator* (const Rotation2D &other) const |
Vector2 | operator* (const Vector2 &vec) const |
Rotation2D & | operator*= (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 |
![]() | |
const Rotation2D< _Scalar > & | derived () const |
Rotation2D< _Scalar > & | derived () |
Rotation2D< _Scalar > | inverse () const |
Transform< Scalar, Dim > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const Scaling< Scalar, Dim > &s) const |
Transform< Scalar, Dim > | operator* (const Transform< Scalar, Dim > &t) const |
RotationMatrixType | toRotationMatrix () const |
Protected Attributes | |
Scalar | m_angle |
Represents a rotation/orientation in a 2 dimensional space.
This is defined in the Geometry module.
_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
|
inline |
Construct a 2D counter clock wise rotation from the angle a in radian.
|
inlineexplicit |
Copy constructor with scalar type conversion
|
inline |
|
inline |
|
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) |
Set *this
from a 2x2 rotation matrix mat. In other words, this function extract the rotation angle from the rotation matrix.
|
inline |
|
inline |
true
if *this
is approximately equal to other, within the precision determined by prec.
|
inline |
Concatenates two rotations
|
inline |
Concatenates two rotations
|
inline |
*this
and other using parameter t. It is in fact equivalent to a linear interpolation. Rotation2D< Scalar >::Matrix2 toRotationMatrix | ( | void | ) | const |
Constructs and