10#ifndef EIGEN_EULERANGLES_H
11#define EIGEN_EULERANGLES_H
35template<
typename Derived>
39 EIGEN_USING_STD(atan2)
43 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived,3,3)
48 const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
50 const Index j = (a0 + 1 + odd)%3;
51 const Index k = (a0 + 2 - odd)%3;
56 if((odd && res[0]<
Scalar(0)) || ((!odd) && res[0]>
Scalar(0)))
59 res[0] -=
Scalar(EIGEN_PI);
62 res[0] +=
Scalar(EIGEN_PI);
65 res[1] = -atan2(s2,
coeff(i,i));
70 res[1] = atan2(s2,
coeff(i,i));
91 if((odd && res[0]<
Scalar(0)) || ((!odd) && res[0]>
Scalar(0))) {
93 res[0] -=
Scalar(EIGEN_PI);
96 res[0] +=
Scalar(EIGEN_PI);
98 res[1] = atan2(-
coeff(i,k), -c2);
101 res[1] = atan2(-
coeff(i,k), c2);
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:66
CoeffReturnType coeff(Index row, Index col) const
Definition DenseCoeffsBase.h:97
const MatrixFunctionReturnValue< Derived > sin() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise sine u...
const MatrixFunctionReturnValue< Derived > cos() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise cosine...
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition EulerAngles.h:37
Matrix< Type, 2, 1 > Vector2
[c++11]
Definition Matrix.h:540
Namespace containing all symbols from the Eigen library.
Definition Core:141
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_cos_op< typename Derived::Scalar >, const Derived > cos(const Eigen::ArrayBase< Derived > &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sin_op< typename Derived::Scalar >, const Derived > sin(const Eigen::ArrayBase< Derived > &x)