Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quaternion division not equal to multiplication with inverse (q1 / q2 != q1 * q2^-1)?

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.

like image 959
herohuyongtao Avatar asked Nov 22 '25 19:11

herohuyongtao


1 Answers

Note that quaternion division leads to an ambiguous notation.

reading from your 2nd reference it states

lem

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

fgi1

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)
like image 185
John Alexiou Avatar answered Nov 25 '25 11:11

John Alexiou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!