aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/EulerAngles/EulerSystem.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-09-22 22:32:55 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-09-22 22:32:55 +0200
commit8f2bdde37385f59c004b8a18e65173f3cf17663e (patch)
tree72e38efc63512aed1f5c29cab1d64d171e52a81a /unsupported/Eigen/src/EulerAngles/EulerSystem.h
parentba0f844d6b8cc26cf315311f536239dbbd330464 (diff)
parent9bcdc8b75669d2a2ec3a7e1fe6ae96854a0bc2e4 (diff)
merge
Diffstat (limited to 'unsupported/Eigen/src/EulerAngles/EulerSystem.h')
-rw-r--r--unsupported/Eigen/src/EulerAngles/EulerSystem.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/unsupported/Eigen/src/EulerAngles/EulerSystem.h b/unsupported/Eigen/src/EulerAngles/EulerSystem.h
index 82243e643..98f9f647d 100644
--- a/unsupported/Eigen/src/EulerAngles/EulerSystem.h
+++ b/unsupported/Eigen/src/EulerAngles/EulerSystem.h
@@ -189,7 +189,12 @@ namespace Eigen
res[0] = atan2(mat(J,K), mat(K,K));
Scalar c2 = Vector2(mat(I,I), mat(I,J)).norm();
if((IsOdd && res[0]<Scalar(0)) || ((!IsOdd) && res[0]>Scalar(0))) {
- res[0] = (res[0] > Scalar(0)) ? res[0] - Scalar(EIGEN_PI) : res[0] + Scalar(EIGEN_PI);
+ if(res[0] > Scalar(0)) {
+ res[0] -= Scalar(EIGEN_PI);
+ }
+ else {
+ res[0] += Scalar(EIGEN_PI);
+ }
res[1] = atan2(-mat(I,K), -c2);
}
else
@@ -212,7 +217,12 @@ namespace Eigen
res[0] = atan2(mat(J,I), mat(K,I));
if((IsOdd && res[0]<Scalar(0)) || ((!IsOdd) && res[0]>Scalar(0)))
{
- res[0] = (res[0] > Scalar(0)) ? res[0] - Scalar(EIGEN_PI) : res[0] + Scalar(EIGEN_PI);
+ if(res[0] > Scalar(0)) {
+ res[0] -= Scalar(EIGEN_PI);
+ }
+ else {
+ res[0] += Scalar(EIGEN_PI);
+ }
Scalar s2 = Vector2(mat(J,I), mat(K,I)).norm();
res[1] = -atan2(s2, mat(I,I));
}