Eigen  3.4.90 (git rev 9589cc4e7fd8e4538bedef80dd36c7738977a8be)
 
Loading...
Searching...
No Matches
Eigen::Rotation2D< Scalar_ > Class Template Reference

#include <Eigen/src/Geometry/Rotation2D.h>

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
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.

See also
class Quaternion, class Transform
+ Inheritance diagram for Eigen::Rotation2D< Scalar_ >:

Public Types

typedef Scalar_ Scalar
 
- Public Types inherited from Eigen::RotationBase< Rotation2D< Scalar_ >, 2 >
typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
 
typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
 
typedef internal::traits< Rotation2D< Scalar_ > >::Scalar Scalar
 
typedef internal::traits< Rotation2D< Scalar_ > >::Scalar Scalar
 

Public Member Functions

Scalarangle ()
 
Scalar angle () const
 
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, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
internal::rotation_base_generic_product_selector< Rotation2D< Scalar_ >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
Rotation2D operator* (const Rotation2D &other) const
 
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
Vector2 operator* (const Vector2 &vec) const
 
Rotation2Doperator*= (const Rotation2D &other)
 
template<typename Derived>
Rotation2Doperator= (const MatrixBase< Derived > &m)
 
 Rotation2D ()
 
template<typename Derived>
 Rotation2D (const MatrixBase< Derived > &m)
 
template<typename OtherScalarType>
 Rotation2D (const Rotation2D< OtherScalarType > &other)
 
 Rotation2D (const Scalar &a)
 
Rotation2D slerp (const Scalar &t, const Rotation2D &other) const
 
Scalar smallestAngle () const
 
Scalar smallestPositiveAngle () const
 
Matrix2 toRotationMatrix () const
 
- Public Member Functions inherited from Eigen::RotationBase< Rotation2D< Scalar_ >, 2 >
Rotation2D< Scalar_ > inverse () const
 
Rotation2D< Scalar_ > inverse () const
 
RotationMatrixType matrix () const
 
RotationMatrixType matrix () const
 
internal::rotation_base_generic_product_selector< Rotation2D< Scalar_ >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
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
 
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
RotationMatrixType toRotationMatrix () const
 
RotationMatrixType toRotationMatrix () const
 

Member Typedef Documentation

◆ Scalar

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

the scalar type of the coefficients

Constructor & Destructor Documentation

◆ Rotation2D() [1/4]

template<typename Scalar_>
Eigen::Rotation2D< Scalar_ >::Rotation2D ( const Scalar & a)
inlineexplicit

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

◆ Rotation2D() [2/4]

template<typename Scalar_>
Eigen::Rotation2D< Scalar_ >::Rotation2D ( )
inline

Default constructor without initialization. The represented rotation is undefined.

◆ Rotation2D() [3/4]

template<typename Scalar_>
template<typename Derived>
Eigen::Rotation2D< Scalar_ >::Rotation2D ( const MatrixBase< Derived > & m)
inlineexplicit

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

See also
fromRotationMatrix()

◆ Rotation2D() [4/4]

template<typename Scalar_>
template<typename OtherScalarType>
Eigen::Rotation2D< Scalar_ >::Rotation2D ( const Rotation2D< OtherScalarType > & other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

◆ angle() [1/2]

template<typename Scalar_>
Scalar & Eigen::Rotation2D< Scalar_ >::angle ( )
inline
Returns
a read-write reference to the rotation angle

◆ angle() [2/2]

template<typename Scalar_>
Scalar Eigen::Rotation2D< Scalar_ >::angle ( ) const
inline
Returns
the rotation angle

◆ cast()

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.

◆ fromRotationMatrix()

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.

◆ inverse()

template<typename Scalar_>
Rotation2D Eigen::Rotation2D< Scalar_ >::inverse ( ) const
inline
Returns
the inverse rotation

◆ isApprox()

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()

◆ operator*() [1/6]

template<typename Scalar_>
internal::rotation_base_generic_product_selector< Rotation2D< Scalar_ >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Rotation2D< Scalar_ >, Dim_ >::operator* ( const EigenBase< OtherDerived > & e) const
inline
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

◆ operator*() [2/6]

template<typename Scalar_>
Rotation2D Eigen::Rotation2D< Scalar_ >::operator* ( const Rotation2D< Scalar_ > & other) const
inline

Concatenates two rotations

◆ operator*() [3/6]

template<typename Scalar_>
Transform< Scalar, Dim, Mode > Eigen::RotationBase< Rotation2D< Scalar_ >, Dim_ >::operator* ( const Transform< Scalar, Dim, Mode, Options > & t) const
inline
Returns
the concatenation of the rotation *this with a transformation t

◆ operator*() [4/6]

template<typename Scalar_>
Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Rotation2D< Scalar_ >, Dim_ >::operator* ( const Translation< Scalar, Dim > & t) const
inline
Returns
the concatenation of the rotation *this with a translation t

◆ operator*() [5/6]

template<typename Scalar_>
RotationMatrixType Eigen::RotationBase< Rotation2D< Scalar_ >, Dim_ >::operator* ( const UniformScaling< Scalar > & s) const
inline
Returns
the concatenation of the rotation *this with a uniform scaling s

◆ operator*() [6/6]

template<typename Scalar_>
Vector2 Eigen::Rotation2D< Scalar_ >::operator* ( const Vector2 & vec) const
inline

Applies the rotation to a 2D vector

◆ operator*=()

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

Concatenates two rotations

◆ operator=()

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()

◆ slerp()

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.

◆ smallestAngle()

template<typename Scalar_>
Scalar Eigen::Rotation2D< Scalar_ >::smallestAngle ( ) const
inline
Returns
the rotation angle in [-pi,pi]

◆ smallestPositiveAngle()

template<typename Scalar_>
Scalar Eigen::Rotation2D< Scalar_ >::smallestPositiveAngle ( ) const
inline
Returns
the rotation angle in [0,2pi]

◆ toRotationMatrix()

template<typename Scalar>
Rotation2D< Scalar >::Matrix2 Eigen::Rotation2D< Scalar >::toRotationMatrix ( void ) const

Constructs and

Returns
an equivalent 2x2 rotation matrix.

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