10 #ifndef EIGEN_EULERANGLESCLASS_H// TODO: Fix previous "EIGEN_EULERANGLES_H" definition? 11 #define EIGEN_EULERANGLESCLASS_H 99 template <
typename _Scalar,
class _System>
119 const Vector3& u = Vector3::Unit(System::AlphaAxisAbs - 1);
120 return System::IsAlphaOpposite ? -u : u;
125 const Vector3& u = Vector3::Unit(System::BetaAxisAbs - 1);
126 return System::IsBetaOpposite ? -u : u;
131 const Vector3& u = Vector3::Unit(System::GammaAxisAbs - 1);
132 return System::IsGammaOpposite ? -u : u;
143 m_angles(alpha, beta, gamma) {}
161 template<
typename Derived>
175 template<
typename Derived>
198 Scalar
alpha()
const {
return m_angles[0]; }
200 Scalar&
alpha() {
return m_angles[0]; }
203 Scalar
beta()
const {
return m_angles[1]; }
205 Scalar&
beta() {
return m_angles[1]; }
208 Scalar
gamma()
const {
return m_angles[2]; }
210 Scalar&
gamma() {
return m_angles[2]; }
237 template<
class Derived>
241 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
254 template<
typename Derived>
272 return static_cast<QuaternionType
>(*this).toRotationMatrix();
284 friend std::ostream& operator<<(std::ostream& s, const EulerAngles<Scalar, System>& eulerAngles)
286 s << eulerAngles.angles().transpose();
291 template <
typename NewScalarType>
300 #define EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(AXES, SCALAR_TYPE, SCALAR_POSTFIX) \ 302 typedef EulerAngles<SCALAR_TYPE, EulerSystem##AXES> EulerAngles##AXES##SCALAR_POSTFIX; 304 #define EIGEN_EULER_ANGLES_TYPEDEFS(SCALAR_TYPE, SCALAR_POSTFIX) \ 305 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XYZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 306 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XYX, SCALAR_TYPE, SCALAR_POSTFIX) \ 307 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XZY, SCALAR_TYPE, SCALAR_POSTFIX) \ 308 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XZX, SCALAR_TYPE, SCALAR_POSTFIX) \ 310 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YZX, SCALAR_TYPE, SCALAR_POSTFIX) \ 311 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YZY, SCALAR_TYPE, SCALAR_POSTFIX) \ 312 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YXZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 313 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YXY, SCALAR_TYPE, SCALAR_POSTFIX) \ 315 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZXY, SCALAR_TYPE, SCALAR_POSTFIX) \ 316 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZXZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 317 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZYX, SCALAR_TYPE, SCALAR_POSTFIX) \ 318 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZYZ, SCALAR_TYPE, SCALAR_POSTFIX) 325 template<
typename _Scalar,
class _System>
332 template<
class System,
class Other>
338 System::CalcEulerAngles(e, m);
343 template<
class System,
class Other>
355 #endif // EIGEN_EULERANGLESCLASS_H
int EIGEN_BLAS_FUNC() rot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
EulerAngles(const RotationBase< Derived, 3 > &rot)
EulerAngles & operator=(const MatrixBase< Derived > &other)
EulerAngles & operator=(const RotationBase< Derived, 3 > &rot)
EulerAngles(const MatrixBase< Derived > &other)
bool isApprox(const EulerAngles &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Quaternion< Scalar > QuaternionType
Matrix< Scalar, 3, 1 > Vector3
Namespace containing all symbols from the Eigen library.
static void run(EulerAngles< Scalar, System > &e, const Other &vec)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EulerAngles(const Scalar *data)
static Vector3 GammaAxisVector()
static Vector3 AlphaAxisVector()
EulerAngles inverse() const
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
RotationBase< EulerAngles< _Scalar, _System >, 3 > Base
AngleAxis< Scalar > AngleAxisType
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Common base class for compact rotation representations.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Represents a rotation in a 3 dimensional space as three Euler angles.
EIGEN_DEVICE_FUNC RotationMatrixType toRotationMatrix() const
#define EIGEN_EULER_ANGLES_TYPEDEFS(SCALAR_TYPE, SCALAR_POSTFIX)
EulerAngles(const Scalar &alpha, const Scalar &beta, const Scalar &gamma)
Matrix< Scalar, 3, 3 > Matrix3
The quaternion class used to represent 3D orientations and rotations.
static void run(EulerAngles< Scalar, System > &e, const Other &m)
NumTraits< Scalar >::Real RealScalar
Matrix3 toRotationMatrix() const
static Vector3 BetaAxisVector()
The matrix class, also used for vectors and row-vectors.
Base class for all dense matrices, vectors, and expressions.
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
EulerAngles operator-() const
EulerAngles< NewScalarType, System > cast() const
const Vector3 & angles() const