| further reading | more topics » |
| mjbWorld program | 3D theory |
3D physics |
3D maths |
3D programming | technology |
about site |
sitemap A-Z |
| index | algebra | geometry | calculus | graph theory | statistics | principles | standards |
index |
space |
elements |
surface |
transformations | trigonometry |
||
| rotation | affine | theory | |||||
index |
angles |
euler |
axis angle |
direction cosines | convertions |
frame-of- reference |
as 2 reflections |
Start from quaternion to axis angle as shown here:
angle = 2 * acos(qw)
x = qx / sqrt(1-qw*qw)
y = qy / sqrt(1-qw*qw)
z = qz / sqrt(1-qw*qw)
Substitute from Euler to Quaternion as shown here:
qw = c1c2c3 + s1s2s3
qx = c1c2s3 - s1s2c3
qy = c1s2c3 + s1c2s3
qz = s1c2c3 - c1s2s3
where:
So, removing common factors which means that x,y,z is no longer normalised
angle = 2 * acos(c1c2c3 + s1s2s3)
x = c1c2s3 - s1s2c3
y = c1s2c3 + s1c2s3
z = s1c2c3 - c1s2s3
to normalise divide x,y and z by:
x2 + y2 + z2 = (c1c2s3 - s1s2c3)2+(c1s2c3 + s1c2s3)2+(s1c2c3 - c1s2s3)2
| we take the 90 degree rotation from this: | to this: | ![]() |
As shown here the axis angle for this rotation is:
heading = 0 degrees
bank = 90 degrees
attitude = 0 degrees
angle = 2 * acos(c1c2c3 + s1s2s3)
= 2 * acos(0.7071) = 90 degrees
x = c1c2s3 - s1s2c3 = 0.7071
y = c1s2c3 + s1c2s3 = 0
z = s1c2c3 - c1s2s3 = 0
So the axis is: (0.7071,0,0)
This can be normalised to: (1,0,0)
So this gives the correct result, see here, but we have to be very careful about the following issues:
|
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. |
|
|
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. |
|
|
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. |
|
|
progam 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: |
|
This site may have errors. Don't use for critical systems.
Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.