logo back up home forward   further reading more topics »

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,
http://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


metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover us uk de jp fr ca On Quaternions and Octonions

cover us uk de jp fr ca Quaternions and Rotation Sequences.

Other Math Books

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

cover Dark Basic Professional Edition - It is better to get this professional edition

cover This is a version of basic designed for building games, for example to rotate a cube you might do the following:
make object cube 1,100
for x=1 to 360
rotate object 1,x,x,0
next x

cover Game Programming with Darkbasic - book for above software

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

Could anyone let me know of a good proof that a quaternion multiplication can be used to represent a rotation in 3 dimensions, I'm not looking for the shortest proof, but the most easily understood.

Terminology and Notation

Specific to this page here:

 

program

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.