This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1713

Summary: Comparison between two quaternions modulo 2*pi
Product: Eigen Reporter: Vincent Samy <vsamy>
Component: GeometryAssignee: Nobody <eigen.nobody>
Status: NEW ---    
Severity: Wrong Result CC: chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: All   
OS: All   
Whiteboard:

Description Vincent Samy 2019-05-14 00:56:12 UTC
Hello,

So i bumped into a problem with quaternion function `isApprox` that tells whether or not two quaternions are the same. Though, quaternions can represent the same rotation and have different values. Here is the code.

Eigen::Quaterniond q1 = Eigen::Quaterniond::UnitRandom();
Eigen::Quaterniond q2(-q1.w(), -q1.x(), -q1.y(), -q1.z());
q1.isApprox(q2); // return false
q1.angularDistance(q2); // return 0

q1 and q2 represent the same rotation (modulo 2*pi), maybe the function should return true?

Best,

Vincent S.
Comment 1 Nobody 2019-12-04 18:38:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1713.