### Concatenating Matrices

Complex transformations are often constructed with a series of transformations. It is important to understand that the two types of multiplication, pre-multiply and post-multiply, if applied to a sequence of transformations, usually give two different results. The two examples below demonstrate the process of transforming an object with a concatenated matrix. The first example shows that matrix is post-rotated and then post-translated.

matrix.setToIdentity();
matrix.rotateBy(30);
matrix.translateBy(IGPoint2D(2,0));

The same transformation operations are rotated and then pre-translated.

matrix.setToIdentity();
matrix.rotateBy(30);
matrix.preTranslateBy(IGPoint2D(2,0));

Notice that the resulting images are very different for the two examples. Post-multiplication is used to manipulate an object in a fixed space. Pre-multiplication is used to manipulate the space itself (such as the windowing system).