Eigne Matrix Class Library

Dependents:   Eigen_test Odometry_test AttitudeEstimation_usingTicker MPU9250_Quaternion_Binary_Serial ... more

Embed: (wiki syntax)

« Back to documentation index

Rotation2D< _Scalar > Class Template Reference

Rotation2D< _Scalar > Class Template Reference
[Geometry module]

More...

#include <Rotation2D.h>

Inherits RotationBase< Rotation2D< _Scalar >, 2 >.

Public Types

typedef _Scalar Scalar
 the scalar type of the coefficients
typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
 corresponding linear transformation matrix type

Public Member Functions

 Rotation2D (const Scalar &a)
 Construct a 2D counter clock wise rotation from the angle a in radian.
 Rotation2D ()
 Default constructor wihtout initialization.
Scalar angle () const
Scalarangle ()
Rotation2D inverse () const
Rotation2D operator* (const Rotation2D &other) const
 Concatenates two rotations.
Rotation2Doperator*= (const Rotation2D &other)
 Concatenates two rotations.
Vector2 operator* (const Vector2 &vec) const
 Applies the rotation to a 2D vector.
template<typename Derived >
Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
 Set *this from a 2x2 rotation matrix mat.
Matrix2 toRotationMatrix () const
 Constructs and.
Rotation2D slerp (const 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, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
RotationMatrixType matrix () const
Transform< Scalar, Dim, Isometry > operator* (const Translation< Scalar, Dim > &t) const
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
EIGEN_STRONG_INLINE
internal::rotation_base_generic_product_selector
< Rotation2D< _Scalar >
, OtherDerived,
OtherDerived::IsVectorAtCompileTime >
::ReturnType 
operator* (const EigenBase< OtherDerived > &e) const
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const

Friends

RotationMatrixType operator* (const EigenBase< OtherDerived > &l, const Rotation2D< _Scalar > &r)
Transform< Scalar, Dim, Affine > operator* (const DiagonalMatrix< Scalar, Dim > &l, const Rotation2D< _Scalar > &r)

Detailed Description

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

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

Definition at line 41 of file Rotation2D.h.


Member Typedef Documentation

typedef Matrix<Scalar,Dim,Dim> RotationMatrixType [inherited]

corresponding linear transformation matrix type

Definition at line 37 of file RotationBase.h.

typedef _Scalar Scalar

the scalar type of the coefficients

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

Definition at line 51 of file Rotation2D.h.


Constructor & Destructor Documentation

Rotation2D ( const Scalar a )

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

Definition at line 62 of file Rotation2D.h.

Rotation2D (  )

Default constructor wihtout initialization.

The represented rotation is undefined.

Definition at line 65 of file Rotation2D.h.

Rotation2D ( const Rotation2D< OtherScalarType > &  other ) [explicit]

Copy constructor with scalar type conversion.

Definition at line 109 of file Rotation2D.h.


Member Function Documentation

Scalar angle (  ) const
Returns:
the rotation angle

Definition at line 68 of file Rotation2D.h.

Scalar& angle (  )
Returns:
a read-write reference to the rotation angle

Definition at line 71 of file Rotation2D.h.

internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type cast (  ) const
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 104 of file Rotation2D.h.

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.

Definition at line 137 of file Rotation2D.h.

Rotation2D inverse (  ) const
Returns:
the inverse rotation

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

Definition at line 74 of file Rotation2D.h.

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

Definition at line 120 of file Rotation2D.h.

RotationMatrixType matrix (  ) const [inherited]
Returns:
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.

Definition at line 50 of file RotationBase.h.

RotationMatrixType operator* ( const UniformScaling< Scalar > &  s ) const [inherited]
Returns:
the concatenation of the rotation *this with a uniform scaling s

Definition at line 60 of file RotationBase.h.

EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector<Rotation2D< _Scalar > ,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType operator* ( const EigenBase< OtherDerived > &  e ) const [inherited]
Returns:
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim

Definition at line 71 of file RotationBase.h.

Rotation2D operator* ( const Rotation2D< _Scalar > &  other ) const

Concatenates two rotations.

Definition at line 77 of file Rotation2D.h.

Transform<Scalar,Dim,Isometry> operator* ( const Translation< Scalar, Dim > &  t ) const [inherited]
Returns:
the concatenation of the rotation *this with a translation t

Definition at line 56 of file RotationBase.h.

Transform<Scalar,Dim,Mode> operator* ( const Transform< Scalar, Dim, Mode, Options > &  t ) const [inherited]
Returns:
the concatenation of the rotation *this with a transformation t

Definition at line 89 of file RotationBase.h.

Vector2 operator* ( const Vector2 vec ) const

Applies the rotation to a 2D vector.

Definition at line 85 of file Rotation2D.h.

Rotation2D& operator*= ( const Rotation2D< _Scalar > &  other )

Concatenates two rotations.

Definition at line 81 of file Rotation2D.h.

Rotation2D slerp ( const Scalar t,
const Rotation2D< _Scalar > &  other 
) const
Returns:
the spherical interpolation between *this and other using parameter t. It is in fact equivalent to a linear interpolation.

Definition at line 95 of file Rotation2D.h.

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

Constructs and.

Returns:
an equivalent 2x2 rotation matrix.

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

Definition at line 149 of file Rotation2D.h.


Friends And Related Function Documentation

RotationMatrixType operator* ( const EigenBase< OtherDerived > &  l,
const Rotation2D< _Scalar > &  r 
) [friend, inherited]
Returns:
the concatenation of a linear transformation l with the rotation r

Definition at line 76 of file RotationBase.h.

Transform<Scalar,Dim,Affine> operator* ( const DiagonalMatrix< Scalar, Dim > &  l,
const Rotation2D< _Scalar > &  r 
) [friend, inherited]
Returns:
the concatenation of a scaling l with the rotation r

Definition at line 80 of file RotationBase.h.