25 #ifndef EIGEN_EULERANGLES_H
26 #define EIGEN_EULERANGLES_H
46 template<
typename Derived>
47 inline Matrix<typename MatrixBase<Derived>::Scalar,3,1>
57 const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
59 const Index j = (a0 + 1 + odd)%3;
60 const Index k = (a0 + 2 - odd)%3;
64 Scalar s = Vector2(coeff(j,i) , coeff(k,i)).norm();
65 res[1] = internal::atan2(s, coeff(i,i));
68 res[0] = internal::atan2(coeff(j,i), coeff(k,i));
69 res[2] = internal::atan2(coeff(i,j),-coeff(i,k));
74 res[2] = (coeff(i,i)>0?1:-1)*internal::atan2(-coeff(k,j), coeff(j,j));
79 Scalar c = Vector2(coeff(i,i) , coeff(i,j)).norm();
80 res[1] = internal::atan2(-coeff(i,k), c);
83 res[0] = internal::atan2(coeff(j,k), coeff(k,k));
84 res[2] = internal::atan2(coeff(i,j), coeff(i,i));
89 res[2] = (coeff(i,k)>0?1:-1)*internal::atan2(-coeff(k,j), coeff(j,j));
99 #endif // EIGEN_EULERANGLES_H