diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-12-01 09:45:56 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-12-01 09:45:56 +0100 |
commit | 6c02cbbb0f1786f5f22285342850250c28845272 (patch) | |
tree | 92aa4c612cd3dd123ff5f4d75b95a2d10e7dd3bd /test/geo_quaternion.cpp | |
parent | 844561939f931643df7d6e2387288bb0fe7b600f (diff) |
Fix matrix to quaternion (and angleaxis) conversion for matrix expression.
Diffstat (limited to 'test/geo_quaternion.cpp')
-rw-r--r-- | test/geo_quaternion.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 17229be4a..761bb52b4 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -49,6 +49,7 @@ template<typename Scalar, int Options> void quaternion(void) */ using std::abs; typedef Matrix<Scalar,3,1> Vector3; + typedef Matrix<Scalar,3,3> Matrix3; typedef Matrix<Scalar,4,1> Vector4; typedef Quaternion<Scalar,Options> Quaternionx; typedef AngleAxis<Scalar> AngleAxisx; @@ -101,6 +102,11 @@ template<typename Scalar, int Options> void quaternion(void) q2 = q1.toRotationMatrix(); VERIFY_IS_APPROX(q1*v1,q2*v1); + Matrix3 rot1(q1); + VERIFY_IS_APPROX(q1*v1,rot1*v1); + Quaternionx q3(rot1.transpose()*rot1); + VERIFY_IS_APPROX(q3*v1,v1); + // angle-axis conversion AngleAxisx aa = AngleAxisx(q1); |