From several docs, like [1] and [2], I learned that divide operation on a quaternion is equivalent to multiply its inverse. That is to say, for two quaternions q1 and q2, we have
However, when I verify this in MATLAB, which will give different results (also verified by further converting them to rotation matrix via quat2rotm). See code below:
q1 = [1 0 1 0];
q2 = [1 0.5 0.5 0.75];
q1 = quatnormalize(q1); % this seems doesn't matter
q2 = quatnormalize(q2); % this seems doesn't matter
res_1 = quatdivide(q1, q2) % this will be [0.7385 0.1231 0.2462 -0.6155]
res_2 = quatmultiply(q1, quatinv(q2)) % this will be [0.7385 -0.6155 0.2462 -0.1231]
Any hint is appreciated.
Note that quaternion division leads to an ambiguous notation.
reading from your 2nd reference it states

To expand upon this see what the result of the two interpretations are:

They differ by the sign of the cross product in the vector part.
I suspect that quatdivide() uses the 2nd convention such as
quatdivide(q1,q2) = quatmultiply(quatinverse(q2),q1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With