10 #ifndef EIGEN_ROTATION2D_H 11 #define EIGEN_ROTATION2D_H 40 template<
typename _Scalar>
47 using Base::operator*;
62 EIGEN_DEVICE_FUNC
explicit inline Rotation2D(
const Scalar&
a) : m_angle(a) {}
71 template<
typename Derived>
74 fromRotationMatrix(m.derived());
78 EIGEN_DEVICE_FUNC
inline Scalar
angle()
const {
return m_angle; }
81 EIGEN_DEVICE_FUNC
inline Scalar&
angle() {
return m_angle; }
106 { m_angle += other.
m_angle;
return *
this; }
109 EIGEN_DEVICE_FUNC Vector2
operator* (
const Vector2& vec)
const 112 template<
typename Derived>
123 template<
typename Derived>
125 {
return fromRotationMatrix(m.derived()); }
141 template<
typename NewScalarType>
146 template<
typename OtherScalarType>
174 template<
typename Scalar>
175 template<
typename Derived>
178 EIGEN_USING_STD_MATH(
atan2)
179 EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime==2 && Derived::ColsAtCompileTime==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
180 m_angle =
atan2(mat.coeff(1,0), mat.coeff(0,0));
186 template<
typename Scalar>
190 EIGEN_USING_STD_MATH(
sin)
191 EIGEN_USING_STD_MATH(
cos)
192 Scalar sinA =
sin(m_angle);
193 Scalar cosA =
cos(m_angle);
194 return (Matrix2() << cosA, -sinA, sinA, cosA).finished();
199 #endif // EIGEN_ROTATION2D_H EIGEN_DEVICE_FUNC Scalar angle() const
static EIGEN_DEVICE_FUNC Rotation2D Identity()
EIGEN_DEVICE_FUNC Rotation2D inverse() const
EIGEN_DEVICE_FUNC bool isApprox(const Rotation2D &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC Rotation2D slerp(const Scalar &t, const Rotation2D &other) const
Namespace containing all symbols from the Eigen library.
RotationBase< Rotation2D< _Scalar >, 2 > Base
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC Rotation2D(const Rotation2D< OtherScalarType > &other)
EIGEN_DEVICE_FUNC const CosReturnType cos() const
static EIGEN_DEVICE_FUNC Matrix< Scalar, 2, 2 > toRotationMatrix(const Scalar &s)
EIGEN_DEVICE_FUNC Scalar smallestAngle() const
EIGEN_DEVICE_FUNC Rotation2D(const MatrixBase< Derived > &m)
EIGEN_DEVICE_FUNC internal::cast_return_type< Rotation2D, Rotation2D< NewScalarType > >::type cast() const
Common base class for compact rotation representations.
EIGEN_DEVICE_FUNC Rotation2D(const Scalar &a)
EIGEN_DEVICE_FUNC Matrix2 toRotationMatrix() const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorUInt128< uint64_t, uint64_t > operator*(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
EIGEN_DEVICE_FUNC Rotation2D & operator*=(const Rotation2D &other)
EIGEN_DEVICE_FUNC Rotation2D & fromRotationMatrix(const MatrixBase< Derived > &m)
Matrix< Scalar, 2, 2 > Matrix2
Represents a rotation/orientation in a 2 dimensional space.
EIGEN_DEVICE_FUNC Rotation2D & operator=(const MatrixBase< Derived > &m)
EIGEN_DEVICE_FUNC Rotation2D operator*(const Rotation2D &other) const
EIGEN_DEVICE_FUNC Scalar & angle()
const AutoDiffScalar< Matrix< typename internal::traits< typename internal::remove_all< DerTypeA >::type >::Scalar, Dynamic, 1 > > atan2(const AutoDiffScalar< DerTypeA > &a, const AutoDiffScalar< DerTypeB > &b)
Rotation2D< double > Rotation2Dd
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Matrix< Scalar, 2, 1 > Vector2
The matrix class, also used for vectors and row-vectors.
Rotation2D< float > Rotation2Df
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
EIGEN_DEVICE_FUNC Rotation2D()
Base class for all dense matrices, vectors, and expressions.
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)
EIGEN_DEVICE_FUNC Scalar smallestPositiveAngle() const