logo back up home forward   further reading more topics »

Maths - Quaternion Notations - Unit 4D Sphere

As we have already seen here, rotations in 3 dimensions have 3 degrees of freedom but if we work purely in 3 dimensions they are non-linear, have singularitys, are difficult to combine and are generally messy to work with.

The solution is to map our 3D rotational space to a subset of 4 dimensional space. We don't just extrude our world into a fourth dimension, instead we map it onto the hyper-surface of a 4 dimensional sphere.

unit 4D sphere

So to do some operation with rotations, such as combining two subsequent rotations, we need to follow the following sequence:

quaternion morphism

If we have a quaternion a + i b + j c + k d to be used to represent rotations then we normalise so that:

a2 + b2 + c2 + d2=1

Which is what we would get if a, b, c and d were coordinates of points on a 4D sphere

It wouldn't work if we squared the part including the imaginary operators: a2 + (i b)2 + (j c)2 + (k d)2

Which would give:

a2 - b2 - c2 - d2

Rotation and Scaling

Imagine that the four dimensions of the quaternion are all drawn perpendicular to each other, this is a bit difficult to draw in 2 dimensions, so we will crunch the 3 imaginary dimensions together for ease of drawing:

axies

On this diagram a straight line through the origin contains all the 4D points representing the same rotation. The red line below might represent, for example, 90° about the y axis.

axies example

As we move along the line we get different scaling factors.

If q = w + x i + y j + z k

where:

then α q = α w + α x i + α y j + α z k

where:

This scaling factor does not effect the rotation, only the magnitude of the output.

If α = 1, that is no scaling just pure rotation, that will be represented by the red circle on the diagram above.

We can see from the diagram that there are two places, representing two quaternions, that the red line and the red circle intersect. So there are two quaternions that represent every rotation, we know that from other pages, but its nice to have it confirmed graphically.


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 Quaternions and Rotation Sequences.

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.

 

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.