10 #ifndef EIGEN_ROTATION2D_H
11 #define EIGEN_ROTATION2D_H
34 template<
typename _Scalar>
struct traits<Rotation2D<_Scalar> >
36 typedef _Scalar Scalar;
40 template<
typename _Scalar>
41 class Rotation2D :
public RotationBase<Rotation2D<_Scalar>,2>
43 typedef RotationBase<Rotation2D<_Scalar>,2> Base;
47 using Base::operator*;
75 {
return m_angle + other.m_angle; }
79 { m_angle += other.m_angle;
return *
this; }
85 template<
typename Derived>
93 {
return m_angle * (1-t) + other.angle() * t; }
100 template<
typename NewScalarType>
101 inline typename internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type
cast()
const
102 {
return typename internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type(*
this); }
105 template<
typename OtherScalarType>
108 m_angle =
Scalar(other.angle());
118 {
return internal::isApprox(m_angle,other.m_angle, prec); }
132 template<
typename Scalar>
133 template<
typename Derived>
137 EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime==2 && Derived::ColsAtCompileTime==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
138 m_angle = atan2(mat.coeff(1,0), mat.coeff(0,0));
144 template<
typename Scalar>
150 Scalar sinA = sin(m_angle);
151 Scalar cosA = cos(m_angle);
152 return (
Matrix2() << cosA, -sinA, sinA, cosA).finished();
157 #endif // EIGEN_ROTATION2D_H