10 #ifndef EIGEN_EULERANGLESCLASS_H// TODO: Fix previous "EIGEN_EULERANGLES_H" definition? 11 #define EIGEN_EULERANGLESCLASS_H 110 template <
typename _Scalar,
class _System>
127 const Vector3& u = Vector3::Unit(System::AlphaAxisAbs - 1);
128 return System::IsAlphaOpposite ? -u : u;
133 const Vector3& u = Vector3::Unit(System::BetaAxisAbs - 1);
134 return System::IsBetaOpposite ? -u : u;
139 const Vector3& u = Vector3::Unit(System::GammaAxisAbs - 1);
140 return System::IsGammaOpposite ? -u : u;
151 m_angles(alpha, beta, gamma) {}
157 template<
typename Derived>
171 template<
typename Derived>
174 bool positiveRangeAlpha,
175 bool positiveRangeBeta,
176 bool positiveRangeGamma) {
178 System::CalcEulerAngles(*
this, m, positiveRangeAlpha, positiveRangeBeta, positiveRangeGamma);
187 template<
typename Derived>
201 template<
typename Derived>
204 bool positiveRangeAlpha,
205 bool positiveRangeBeta,
206 bool positiveRangeGamma) {
208 System::CalcEulerAngles(*
this, rot.
toRotationMatrix(), positiveRangeAlpha, positiveRangeBeta, positiveRangeGamma);
217 Scalar
alpha()
const {
return m_angles[0]; }
219 Scalar&
alpha() {
return m_angles[0]; }
222 Scalar
beta()
const {
return m_angles[1]; }
224 Scalar&
beta() {
return m_angles[1]; }
227 Scalar
gamma()
const {
return m_angles[2]; }
229 Scalar&
gamma() {
return m_angles[2]; }
261 bool PositiveRangeAlpha,
262 bool PositiveRangeBeta,
263 bool PositiveRangeGamma,
270 System::template CalcEulerAngles<
271 PositiveRangeAlpha, PositiveRangeBeta, PositiveRangeGamma, _Scalar>(
e,
m);
287 bool PositiveRangeAlpha,
288 bool PositiveRangeBeta,
289 bool PositiveRangeGamma,
293 return FromRotation<PositiveRangeAlpha, PositiveRangeBeta, PositiveRangeGamma>(rot.
toRotationMatrix());
311 template<
typename Derived>
315 System::CalcEulerAngles(*
this, m);
322 template<
typename Derived>
333 return static_cast<QuaternionType
>(*this).toRotationMatrix();
345 friend std::ostream& operator<<(std::ostream& s, const EulerAngles<Scalar, System>& eulerAngles)
347 s << eulerAngles.angles().transpose();
352 #define EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(AXES, SCALAR_TYPE, SCALAR_POSTFIX) \ 354 typedef EulerAngles<SCALAR_TYPE, EulerSystem##AXES> EulerAngles##AXES##SCALAR_POSTFIX; 356 #define EIGEN_EULER_ANGLES_TYPEDEFS(SCALAR_TYPE, SCALAR_POSTFIX) \ 357 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XYZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 358 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XYX, SCALAR_TYPE, SCALAR_POSTFIX) \ 359 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XZY, SCALAR_TYPE, SCALAR_POSTFIX) \ 360 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(XZX, SCALAR_TYPE, SCALAR_POSTFIX) \ 362 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YZX, SCALAR_TYPE, SCALAR_POSTFIX) \ 363 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YZY, SCALAR_TYPE, SCALAR_POSTFIX) \ 364 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YXZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 365 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(YXY, SCALAR_TYPE, SCALAR_POSTFIX) \ 367 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZXY, SCALAR_TYPE, SCALAR_POSTFIX) \ 368 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZXZ, SCALAR_TYPE, SCALAR_POSTFIX) \ 369 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZYX, SCALAR_TYPE, SCALAR_POSTFIX) \ 370 EIGEN_EULER_ANGLES_SINGLE_TYPEDEF(ZYZ, SCALAR_TYPE, SCALAR_POSTFIX) 377 template<
typename _Scalar,
class _System>
386 #endif // EIGEN_EULERANGLESCLASS_H EIGEN_DEVICE_FUNC RotationMatrixType toRotationMatrix() const
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 RotationBase< Derived, 3 > &rot)
Quaternion< Scalar > QuaternionType
Matrix< Scalar, 3, 1 > Vector3
Namespace containing all symbols from the Eigen library.
static EulerAngles FromRotation(const RotationBase< Derived, 3 > &rot)
static Vector3 GammaAxisVector()
static Vector3 AlphaAxisVector()
EulerAngles & operator=(const MatrixBase< Derived > &m)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EulerAngles inverse() const
AngleAxis< Scalar > AngleAxisType
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS)
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.
const Vector3 & angles() const
#define EIGEN_EULER_ANGLES_TYPEDEFS(SCALAR_TYPE, SCALAR_POSTFIX)
Matrix3 toRotationMatrix() const
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.
EulerAngles(const MatrixBase< Derived > &m, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma)
static Vector3 BetaAxisVector()
The matrix class, also used for vectors and row-vectors.
EulerAngles(const MatrixBase< Derived > &m)
Base class for all dense matrices, vectors, and expressions.
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
static EulerAngles FromRotation(const MatrixBase< Derived > &m)
EulerAngles operator-() const
EulerAngles(const RotationBase< Derived, 3 > &rot, bool positiveRangeAlpha, bool positiveRangeBeta, bool positiveRangeGamma)