aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_quaternion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/geo_quaternion.cpp')
-rw-r--r--test/geo_quaternion.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp
index 06b3af7c1..1694b32c7 100644
--- a/test/geo_quaternion.cpp
+++ b/test/geo_quaternion.cpp
@@ -31,14 +31,14 @@ template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType&
Scalar theta_tot = AA(q1*q0.inverse()).angle();
if(theta_tot>M_PI)
- theta_tot = 2.*M_PI-theta_tot;
- for(Scalar t=0; t<=1.001; t+=0.1)
+ theta_tot = Scalar(2.*M_PI)-theta_tot;
+ for(Scalar t=0; t<=Scalar(1.001); t+=Scalar(0.1))
{
QuatType q = q0.slerp(t,q1);
Scalar theta = AA(q*q0.inverse()).angle();
VERIFY(abs(q.norm() - 1) < largeEps);
if(theta_tot==0) VERIFY(theta_tot==0);
- else VERIFY(abs(theta/theta_tot - t) < largeEps);
+ else VERIFY(abs(theta - t * theta_tot) < largeEps);
}
}
@@ -156,7 +156,7 @@ template<typename Scalar, int Options> void quaternion(void)
check_slerp(q1,q2);
q1 = AngleAxisx(b, v1.normalized());
- q2 = AngleAxisx(b+M_PI, v1.normalized());
+ q2 = AngleAxisx(b+Scalar(M_PI), v1.normalized());
check_slerp(q1,q2);
q1 = AngleAxisx(b, v1.normalized());