Fix method 'difference'
When switching to the double covered quaternion pair, the corresponding distance was not computed correctly
Merge request reports
Activity
assigned to @osander
I found the bug when using the interpolate method to create initial configurations. There, the prescribed end values were not the same anymore (in the recomputed values resulting from
interpolate
). One can see that it is a bug as follows:- The double coverage pair of a given quaternion
q
is given by-q
, which is changed in the code if the two input parameters ofdifference
are not in the same half of the coverage. - In this case the parameter
dist = 2*acos(q[3])
needs to be adjusted accordingly. SonewDist = 2*acos(-q[3])
. Using the symmetry ofacos
which is given byacos(x) = PI - acos(-x)
one can derive thatdist = 2*acos(q[3]) = 2*PI - 2*acos(-q[3])
and hencenewDist = 2*PI - 2*acos(q[3]) = 2*PI - dist
Is this sufficient?
- The double coverage pair of a given quaternion
Here is a small test that is interpolating between two rotations to illustrate the failure.
added 2 commits
mentioned in issue #1 (closed)
mentioned in commit acd17b13
Please register or sign in to reply