48 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived, 3, 3)
52 const Index odd = ((a0 + 1) % 3 == a1) ? 0 : 1;
54 const Index j = (a0 + 1 + odd) % 3;
55 const Index k = (a0 + 2 - odd) % 3;
66 Scalar s2 = numext::hypot(coeff(j, i), coeff(k, i));
68 res[0] = numext::atan2(coeff(j, i), coeff(k, i));
70 res[1] = numext::atan2(s2, coeff(i, i));
80 res[0] = numext::atan2(-coeff(j, i), -coeff(k, i));
81 res[1] = -numext::atan2(s2, coeff(i, i));
94 Scalar s1 = numext::sin(res[0]);
95 Scalar c1 = numext::cos(res[0]);
96 res[2] = numext::atan2(c1 * coeff(j, k) - s1 * coeff(k, k), c1 * coeff(j, j) - s1 * coeff(k, j));
105 res[0] = numext::atan2(coeff(j, k), coeff(k, k));
107 Scalar c2 = numext::hypot(coeff(i, i), coeff(i, j));
110 res[1] = numext::atan2(-coeff(i, k), c2);
112 Scalar s1 = numext::sin(res[0]);
113 Scalar c1 = numext::cos(res[0]);
114 res[2] = numext::atan2(s1 * coeff(k, i) - c1 * coeff(j, i), c1 * coeff(j, j) - s1 * coeff(k, j));
139 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived, 3, 3)
143 const Index odd = ((a0 + 1) % 3 == a1) ? 0 : 1;
145 const Index j = (a0 + 1 + odd) % 3;
146 const Index k = (a0 + 2 - odd) % 3;
149 res[0] = numext::atan2(coeff(j, i), coeff(k, i));
150 if ((odd && res[0] <
Scalar(0)) || ((!odd) && res[0] >
Scalar(0))) {
152 res[0] -=
Scalar(EIGEN_PI);
154 res[0] +=
Scalar(EIGEN_PI);
157 Scalar s2 = numext::hypot(coeff(j, i), coeff(k, i));
158 res[1] = -numext::atan2(s2, coeff(i, i));
160 Scalar s2 = numext::hypot(coeff(j, i), coeff(k, i));
161 res[1] = numext::atan2(s2, coeff(i, i));
174 Scalar s1 = numext::sin(res[0]);
175 Scalar c1 = numext::cos(res[0]);
176 res[2] = numext::atan2(c1 * coeff(j, k) - s1 * coeff(k, k), c1 * coeff(j, j) - s1 * coeff(k, j));
178 res[0] = numext::atan2(coeff(j, k), coeff(k, k));
179 Scalar c2 = numext::hypot(coeff(i, i), coeff(i, j));
180 if ((odd && res[0] <
Scalar(0)) || ((!odd) && res[0] >
Scalar(0))) {
182 res[0] -=
Scalar(EIGEN_PI);
184 res[0] +=
Scalar(EIGEN_PI);
186 res[1] = numext::atan2(-coeff(i, k), -c2);
188 res[1] = numext::atan2(-coeff(i, k), c2);
190 Scalar s1 = numext::sin(res[0]);
191 Scalar c1 = numext::cos(res[0]);
192 res[2] = numext::atan2(s1 * coeff(k, i) - c1 * coeff(j, i), c1 * coeff(j, j) - s1 * coeff(k, j));
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition EulerAngles.h:136
Matrix< Scalar, 3, 1 > canonicalEulerAngles(Index a0, Index a1, Index a2) const
Definition EulerAngles.h:45