$treeview $search $mathjax
Eigen  3.2.5
$projectbrief
$projectbrief
$searchbox

Rotation2D< _Scalar > Class Template Reference
[Geometry module]

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

Inheritance diagram for Rotation2D< _Scalar >:

List of all members.

Public Types

typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
typedef _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 >
Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
Rotation2D inverse () const
bool isApprox (const Rotation2D &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
RotationMatrixType matrix () const
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
internal::rotation_base_generic_product_selector
< Rotation2D< _Scalar >
, OtherDerived,
OtherDerived::IsVectorAtCompileTime >
::ReturnType 
operator* (const EigenBase< OtherDerived > &e) const
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
Transform< Scalar, Dim, Isometry > operator* (const Translation< Scalar, Dim > &t) const
Vector2 operator* (const Vector2 &vec) const
Rotation2D operator* (const Rotation2D &other) const
Rotation2Doperator*= (const Rotation2D &other)
template<typename OtherScalarType >
 Rotation2D (const Rotation2D< OtherScalarType > &other)
 Rotation2D ()
 Rotation2D (const Scalar &a)
Rotation2D slerp (const Scalar &t, const Rotation2D &other) const
Matrix2 toRotationMatrix () const

Friends

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

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

Member Typedef Documentation

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

corresponding linear transformation matrix type

typedef _Scalar Scalar

the scalar type of the coefficients

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


Constructor & Destructor Documentation

Rotation2D ( const Scalar a  )  [inline]

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

Rotation2D (  )  [inline]

Default constructor wihtout initialization. The represented rotation is undefined.

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

Copy constructor with scalar type conversion

References Rotation2D< _Scalar >::angle().


Member Function Documentation

Scalar& angle (  )  [inline]
Returns:
a read-write reference to the rotation angle
Scalar angle (  )  const [inline]
Returns:
the rotation angle

Referenced by Rotation2D< _Scalar >::Rotation2D(), and Rotation2D< _Scalar >::slerp().

internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type 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.

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]
Returns:
the inverse rotation

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

bool 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()
RotationMatrixType matrix (  )  const [inline, inherited]
Returns:
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
Transform<Scalar,Dim,Mode> operator* ( const Transform< Scalar, Dim, Mode, Options > &  t  )  const [inline, inherited]
Returns:
the concatenation of the rotation *this with a transformation t
internal::rotation_base_generic_product_selector<Rotation2D< _Scalar > ,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType operator* ( const EigenBase< OtherDerived > &  e  )  const [inline, 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
RotationMatrixType operator* ( const UniformScaling< Scalar > &  s  )  const [inline, inherited]
Returns:
the concatenation of the rotation *this with a uniform scaling s
Transform<Scalar,Dim,Isometry> operator* ( const Translation< Scalar, Dim > &  t  )  const [inline, inherited]
Returns:
the concatenation of the rotation *this with a translation t
Vector2 operator* ( const Vector2 vec  )  const [inline]

Applies the rotation to a 2D vector

References Rotation2D< _Scalar >::toRotationMatrix().

Rotation2D operator* ( const Rotation2D< _Scalar > &  other  )  const [inline]

Concatenates two rotations

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

Concatenates two rotations

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

References Rotation2D< _Scalar >::angle().

Rotation2D< Scalar >::Matrix2 toRotationMatrix ( void   )  const [inline]

Constructs and

Returns:
an equivalent 2x2 rotation matrix.

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

Referenced by Rotation2D< _Scalar >::operator*().


Friends And Related Function Documentation

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

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