# Maths - Quaternions - Open Forum Discussion

By: nobody ( Nobody/Anonymous )
Quaternion Inversion
2003-04-19 00:14
Reading your page on quaternions described as an angle-axis representation where the axis consisted of complex numbers has helped me out. I was faced with a situation where I had to invert a rotation. Previously I had been converting the quaternion to a rotation matrix then finding the Inversion to the rotation matrix and converting the inverted matrix back into a quaternion. After reading your page I tried negating the w (angle value) in the quaternion. This is just rotating about the same axis as the original quaternion in the opposite direction. It seems to work, however I would appreciate any comments if someone knows of something wrong with doing this. Anyways this is much faster than inverting the matrix.

By: martinbaker ( Martin Baker )
RE: Quaternion Inversion
2003-04-19 07:03
The inverse of a quaternion number is its conjugate (assuming that it is normalised, which it will be if it is representing a rotation) .

conj(a + b i + c j + d k) = a - b i - c j - d k

So instead of taking minus the real value, as you did, try taking minus all the complex values.

Looking at the web page,
https://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/index.htm
this was not explained very well, so Ill try to improve it. It helps to hear from you so that I can get an idea of what works.

Cheers,

Martin

By: nobody ( Nobody/Anonymous )
RE: Quaternion Inversion
2003-04-19 17:57
I have tried what you have suggested and it works also. Both methods appear to work identically for me although I suspect there may be weird cases where my method fails. Intuitively it seems to me inverting the axis will result in the same rotation as inverting the angle. After all you are rotating about the same axis ( if you extend the original axis through the center point you will be on the inverted axis ) just in the opposite direction as the original rotation. There may be some weird symmetry case which I have not considered. There should be a proof somwhere saying these are or are not equivalent rotations which would be interesting to see. I think that this could apply to regular angle axis representation of angles also. I am using your method because I believe you have more of a mathmatical body of work supporting you.

By: martinbaker ( Martin Baker )
RE: Quaternion Inversion
2003-04-20 08:48
Yes, I think your right, I never really thought this through before.

To get from a quaternion with minus the imaginary parts to a matrix to a quaternion with minus the real part we have to take minus all values.

It seems to me that (qw,qx,qy,qz) and (-qw-,qx,-qy,-qz) will produce exactly the same rotation because if we look at the quaternion to matrix conversion all the terms consist of a product of 2 of these elements so the minus values will cancel out.

Thanks for pointing this out,

Martin