Path Tracer
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
Eigen::Rotation2D< _Scalar > Class Template Reference

Represents a rotation/orientation in a 2 dimensional space. More...

#include <Rotation2D.h>

Public Types

enum  { Dim = 2 }
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar, 2, 1 > Vector2
 
typedef Matrix< Scalar, 2, 2 > Matrix2
 

Public Member Functions

EIGEN_DEVICE_FUNC Rotation2D (const Scalar &a)
 
EIGEN_DEVICE_FUNC Rotation2D ()
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Scalar angle () const
 
EIGEN_DEVICE_FUNC Scalarangle ()
 
EIGEN_DEVICE_FUNC Scalar smallestPositiveAngle () const
 
EIGEN_DEVICE_FUNC Scalar smallestAngle () const
 
EIGEN_DEVICE_FUNC Rotation2D inverse () const
 
EIGEN_DEVICE_FUNC Rotation2D operator* (const Rotation2D &other) const
 
EIGEN_DEVICE_FUNC Rotation2Doperator*= (const Rotation2D &other)
 
EIGEN_DEVICE_FUNC Vector2 operator* (const Vector2 &vec) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Matrix2 toRotationMatrix () const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2Doperator= (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Rotation2D slerp (const Scalar &t, const Rotation2D &other) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Rotation2D, Rotation2D< NewScalarType > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Rotation2D (const Rotation2D< OtherScalarType > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const Rotation2D &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D< Scalar > & fromRotationMatrix (const MatrixBase< Derived > &mat)
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Rotation2D Identity ()
 

Protected Attributes

Scalar m_angle
 

Friends

template<typename OtherDerived >
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const EigenBase< OtherDerived > &l, const Derived &r)
 
EIGEN_DEVICE_FUNC friend Transform< Scalar, Dim, Affineoperator* (const DiagonalMatrix< Scalar, Dim > &l, const Derived &r)
 

Detailed Description

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

Represents a rotation/orientation in a 2 dimensional space.

\geometry_module

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

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_DEVICE_FUNC 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_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( )
inline

Default constructor wihtout initialization. The represented rotation is undefined.

◆ Rotation2D() [3/4]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC 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_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( const Rotation2D< OtherScalarType > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

◆ angle() [1/2]

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

◆ angle() [2/2]

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

◆ cast()

template<typename _Scalar >
template<typename NewScalarType >
EIGEN_DEVICE_FUNC 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 >
EIGEN_DEVICE_FUNC 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 >
EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::inverse ( ) const
inline
Returns
the inverse rotation

◆ isApprox()

template<typename _Scalar >
EIGEN_DEVICE_FUNC 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 >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType Eigen::RotationBase< Derived, _Dim >::operator* ( typename OtherDerived  )
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 >
EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::operator* ( const Rotation2D< _Scalar > &  other) const
inline

Concatenates two rotations

◆ operator*() [3/6]

template<typename _Scalar >
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Mode> Eigen::RotationBase< Derived, _Dim >::operator* ( int  Mode,
int  Options 
)
inline
Returns
the concatenation of the rotation *this with a transformation t

◆ operator*() [4/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Transform<Scalar,Dim,Isometry> Eigen::RotationBase< Derived, _Dim >::operator*
inline
Returns
the concatenation of the rotation *this with a translation t

◆ operator*() [5/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::operator*
inline
Returns
the concatenation of the rotation *this with a uniform scaling s

◆ operator*() [6/6]

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

Applies the rotation to a 2D vector

◆ operator*=()

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

Concatenates two rotations

◆ operator=()

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC 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 >
EIGEN_DEVICE_FUNC 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 >
EIGEN_DEVICE_FUNC Scalar Eigen::Rotation2D< _Scalar >::smallestAngle ( ) const
inline
Returns
the rotation angle in [-pi,pi]

◆ smallestPositiveAngle()

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

◆ toRotationMatrix()

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

Constructs and

Returns
an equivalent 2x2 rotation matrix.

Friends And Related Function Documentation

◆ operator* [1/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC friend Transform<Scalar,Dim,Affine> operator*
friend
Returns
the concatenation of a scaling l with the rotation r

◆ operator* [2/2]

template<typename _Scalar >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC RotationMatrixType operator* ( typename OtherDerived  )
friend
Returns
the concatenation of a linear transformation l with the rotation r

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