10 #ifndef EIGEN_EULERANGLES_H
11 #define EIGEN_EULERANGLES_H
31 template<
typename Derived>
32 inline Matrix<typename MatrixBase<Derived>::Scalar,3,1>
36 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived,3,3)
42 const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
44 const Index j = (a0 + 1 + odd)%3;
45 const Index k = (a0 + 2 - odd)%3;
49 Scalar s = Vector2(coeff(j,i) , coeff(k,i)).norm();
50 res[1] = internal::atan2(s, coeff(i,i));
53 res[0] = internal::atan2(coeff(j,i), coeff(k,i));
54 res[2] = internal::atan2(coeff(i,j),-coeff(i,k));
59 res[2] = (coeff(i,i)>0?1:-1)*internal::atan2(-coeff(k,j), coeff(j,j));
64 Scalar c = Vector2(coeff(i,i) , coeff(i,j)).norm();
65 res[1] = internal::atan2(-coeff(i,k), c);
68 res[0] = internal::atan2(coeff(j,k), coeff(k,k));
69 res[2] = internal::atan2(coeff(i,j), coeff(i,i));
74 res[2] = (coeff(i,k)>0?1:-1)*internal::atan2(-coeff(k,j), coeff(j,j));
84 #endif // EIGEN_EULERANGLES_H