logo back up home forward   further reading more topics »

Maths - Transformations Theory

This page introduces the subject of transformations and links on to other pages which analyse the various types of transform in more detail.

A transform maps every point in space to a (possibly) different point.

rotation

There are lots of ways to categorise transforms, one way is to start with the simple transforms that we intuitively understand like:

We can combine these in various ways: combinations of translation and rotation, known as isometries, are important because they represent the ways that solid objects can move in the world without changing shape.

We can also categorise by the types of algebra that can produce the transform, for example, linear (matrix) algebra.

Also we can do transforms in different numbers of dimensions.

Here is an (incomplete) attempt to categorise these things:

transform types

Its hard to categorise these things in a definitive way, for example, projective transforms can be considered linear if we use homogeneous coordinates.

There are different algebras that can represent transforms and help us calculate the effect of different operations, such as combining two transforms, not all of these algebras can represent all transforms. Useful algebras include:

Isomorphism

We need to have an equivalence between our algebra and the physical transforms, this equivalence is known as an isomorphism (discussed on this page).

isomorphism

We need an operation, denoted by 'o' here, which represents composition of rotation. The mapping between elements in the algebra and the physical position of the object is represented by 'φ'. We need this to give the same result regardless of whether we do the composition first or the mapping to the real world first, which means,

φ(v1) o φ(v2) = φ(v1 o v2)

where:

If the group operation 'o' is vector addition '+' then the isomorphism relationship will hold if for the mapping φ(v) we use scalar multiplication m*v which gives:

m*v1 + m*v2 = m*(v1 + v2)

This is known as a vector space and it can be used to represent translations in space.

If the group operation 'o' is quaternion multiplication '*' then the isomorphism relationship will hold if for the mapping φ(v) we use the 'sandwich product' : φ(v) = q v q-1 so

φ(q1*q2) = q q1 q2 q-1
= q q1 q-1 q q2 q-1
= φ(q1)*φ(q2)

(since q-1 q =1)

This 'sandwich product' occurs in many algebras with multiplication such as quaternions, clifford algebra and so on and can represent transforms such as rotations. In the general case this can be thought of as multiplication of vector spaces.

If we try this approach with matrix multiplication we get:

[M][v1] * [M][v2] = [M][v1 * v2]

Which requires the definition of the multiplication of two vectors, if we take the dot product we have:

[M][v1] • [M][v2] = [M][v1 • v2]

So if we take v1 and v2 as being orthogonal to each other, say vx and vy then,

[M][vx] • [M][vy] = [M][vx• vy] = 0

So we need a matrix [M] that, if vectors are orthogonal, then the matrix [M] will maintain that orthogonality. A rotation matrix is such a matrix.

Linear Transforms

Calculations on linear transforms can be done most conveniently using vectors and matrices like this:

v_out0
v_out1
=
m00 m01
m10 m11
v_in0
v_in1

The details of how to calculate these transforms are shown on this page.

If we want to include translations then we can use vector addition as follows:

v_out0
v_out1
=
m00 m01
m10 m11
v_in0
v_in1
+
trans0
trans1

Or, alternatively, we can avoid addition (which makes it easier to combine successive transforms) by increasing the dimension of the vectors and matrices like this:

v_out0
v_out1
0
=
m00 m01 0
m10 m11 0
trans0 trans1 1
v_in0
v_in1
0

We can work in higher dimensions by increasing the dimension of the vectors and matrices.

If we want to restrict ourselves to rotations and translations (perhaps occasionally scaling) then we may find other types of algebra more convenient. For instance, to represent a two dimensional rotation and translation, we might use:

v_out = v_in0 * rotation + translation

where these quantities are all complex numbers.

Again we can remove the need for addition by increasing the dimension of our mathematical element, in this case we could use dualComplex numbers.

Again we can work in a higher number of dimensions (say 3D) by using quaternions or dual quaternions. In that case the form of the equations changes to use the 'sandwich form' as described on these pages.

We can completely generalise this to 'n' dimensions by using an even subset of Clifford Algebra.

Projective Transforms

This extends the possible types of transforms to include things like reflection in a circle or sphere. It is an important subject because its used when we are representing a 3D world on a 2D plane in a way that it appears to our eye. For instance: horizontal lines appear to meet at the horizon. For an application of this see OpenGL pages.

Projective transforms and the Möbius transform are also important in physics, for instance, Roger Penrose uses the stereographic projection to analyse relativity.

Although projective transforms are not, in general, linear (they are a superset of linear transforms) they can be specified in a linear like form (matrix whose elements are complex numbers) by converting to homogeneous coordinates.

projective transform

More information about projective transforms on this page.

Transform Parameters

There are a number of quantities associated with each transform including the following:

Determinants

This tends to be associated, in peoples minds, with matrices. In fact it can have a geometric meaning which can be calculated from other types of algebras.

It is a scalar value and it is related to:

In other words does it make an object bigger or smaller and does it reflect it (an odd number of times).

The calculation of determinants, in the case of matrices, is shown on these pages.

Eigenvalues and Eigenvectors

This also tends to be associated, in peoples minds, with matrices. Again these quantities can have a geometric meaning which can be calculated from other types of algebras.

This tells us something about the symmetry of a transform.

An eigenvector is a vector whose direction is not changed by the transform, it may be stretched, but it still points in the same direction.

Each eigenvector has a corresponding eigenvalue which gives the scaling factor by which the transform scales the eigenvector. So the eigenvector is a vector and the eigenvalue is a scalar.

A given transform may have more than one eigenvector and eigenvalue pair depending on how many dimensions we are working in. For instance:

and so on.

The calculation of eigenvectors and eigenvalues, in the case of matrices, is shown on these pages.

As an example, if we have a rotation transform in 3 dimensions, then the eigenvector would be the axis of rotation since this is not altered by the transform and the corresponding eigenvalue would be +1 since the axis is not scaled by the rotation. If we have a rotation in 2 dimensions then the eigenvectors would be ±i where i is √-1 since all vectors in the plane change direction.

Another geometrical application of eigenvectors and eigenvalues is to attempt to factor transforms into rotational and scaling parts, this is discussed on this page.

A more physical application is to the inertia tensor where the eigenvectors indicate the axies that the solid object will rotate around without wobble.

Next

An important class of transforms are rotations and so we can go on to look at these in more detail on these pages.


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 3D Math Primer - Aimed at complete beginners to vector and matrix algebra.

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.

 

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:

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

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

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