10 #ifndef EIGEN_EULERANGLES_H 11 #define EIGEN_EULERANGLES_H 35 template<
typename Derived>
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;
55 res[0] =
atan2(coeff(j,i), coeff(k,i));
56 if((odd && res[0]<
Scalar(0)) || ((!odd) && res[0]>
Scalar(0)))
59 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
60 res[1] = -
atan2(s2, coeff(i,i));
64 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
65 res[1] =
atan2(s2, coeff(i,i));
80 res[2] =
atan2(c1*coeff(j,k)-s1*coeff(k,k), c1*coeff(j,j) - s1 * coeff(k,j));
84 res[0] =
atan2(coeff(j,k), coeff(k,k));
85 Scalar c2 = Vector2(coeff(i,i), coeff(i,j)).norm();
86 if((odd && res[0]<
Scalar(0)) || ((!odd) && res[0]>
Scalar(0))) {
88 res[1] =
atan2(-coeff(i,k), -c2);
91 res[1] =
atan2(-coeff(i,k), c2);
94 res[2] =
atan2(s1*coeff(k,i)-c1*coeff(j,i), c1*coeff(j,j) - s1 * coeff(k,j));
104 #endif // EIGEN_EULERANGLES_H USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
internal::traits< Derived >::Index Index
The type of indices.
const AutoDiffScalar< Matrix< typename internal::traits< DerTypeA >::Scalar, Dynamic, 1 > > atan2(const AutoDiffScalar< DerTypeA > &a, const AutoDiffScalar< DerTypeB > &b)
iterative scaling algorithm to equilibrate rows and column norms in matrices
internal::traits< Derived >::Scalar Scalar
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
IntermediateState cos(const Expression &arg)
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS)
Abstract base class for interfacing tailored matrix-vector operations.