Matrix Transformations


Matrix Transformations

Matrix transformations are performed through matrix multiplication of a point matrix by a transformation matrix. The transformation matrix affects the point matrix, creating a new point matrix.
[T][P]=[N] where:


The matrices are multiplied in this order in order to obtain a new point matrix and not a larger matrix.

A point matrix, P, takes the form of an n x 1 though generally, 2 x 1 and 3 x 1 matrices are generally used as they model 2D and 3D systems respectivey. The value P1,1 is the x co-ordinate and the value P2,1 is the y co-ordinate. In a 3D point matrix the value of P3,1 is the z co-ordinate.

For example:
point matrix (4,3) =point matrix co-ordinate system graph of point matrix (4,3)

A random 3 x 1 matrix is the form x,y,z matrixTherefore, the co-ordinates of this point matrix are: (4,3,1)

A transformation matrix is a square matrix which has an affect on a point matrix so as to transform it's position on it's co-ordinate axis when they are multiplied. The no. of rows of the point matrix determines the dimensions of the transformation matrix as the no. of columns of the transformation matrix must equal the no. of rows of the point matrix in order to allow matrix multiplication to occur as previously discussed in Basic Matrix Arithmetic.

For example:A Transformation Matrix This transformation matrix will affect a reflection in the line y=x for the point matrix, as shown in the example below:

Transformation Matrix Point MatrixMultiplicationNew Point Matrix
y=x reflection matrixPoint Matrix=Multiplication =New Matrix

Graph of New Point Matrix The transformation matrix has caused the point matrix to reflect in the line y=x creating the co-ordinate (3,4) from the co-ordinate (4,3).

A list of some 2D transformation matrices and their affects can be found in the section 2D Matrix Rotations and Reflections.
The point matrix denoting the co-ordinates (4,3) will be used as an example throughout this page in order to emphasise the changes that are taking placing in the point matrices under transformation matrices.

Return to the Top of the Page

2D Matrix Rotations and Reflections

Matrix rotation and reflection is achieved through matrix multiplication with specific matrices which achieve certain rotations or reflections. This is effectively plotting the co-ordinates of the previous matrix and then matrix multiplying it and ending up with new co-ordinates of the matrix at another point on the graph.

There are a few rules which need to be followed when rotating or reflecting a matrix:

  1. The transformation matrix is always the leading matrix in the multiplication [T][P]=[N] where:
  2. A point matrix is a n x 1 vector as it describes a point on a graph
  3. The no. of rows of the transformation matrix must equal the no. of columns of the point matrix.

The matrices listed below all perform different rotations/reflections:

Transformation MatrixAffect of Transformation Matrix
on Point Matrix
Example
2 x 2 identity matrixThis transformation matrix is the identity matrix. When multiplying by this matrix, the point matrix is unaffected and the new matrix is exactly the same as the point matrix.
2 x 2 identity matrixPoint Matrix=Multiplication =New Matrix
y-axis reflection matrixThis transformation matrix creates a reflection in the x-axis. When multiplying by this matrix, the x co-ordinate remains unchanged, but the y co-ordinate changes sign.
y-axis reflection matrixPoint Matrix=Multiplication =New Matrix
x-axis reflection matrixThis transformation matrix creates a reflection in the y-axis. When multiplying by this matrix, the y co-ordiante remains unchanged, but the x co-ordinate changes sign.
x-axis reflection matrixPoint Matrix=Multiplication =New Matrix
180 degree rotation matrixThis transformation matrix creates a rotation of 180 degrees. When multiplying by this matrix, the point matrix is rotated 180 degrees around (0,0). This changes the sign of both the x and y co-ordinates.
180 degree rotation matrixPoint Matrix=Multiplication =New Matrix
y=x reflection matrixThis transformation matrix creates a reflection in the line y=x. When multiplying by this matrix, the x co-ordinate becomes the y co-ordinate and the y-ordinate becomes the x co-ordinate.
y=x reflection matrixPoint Matrix=Multiplication =New Matrix
90 degrees clockwise rotation matrixThis transformation matrix rotates the point matrix 90 degrees clockwise. When multiplying by this matrix, the point matrix is rotated 90 degrees clockwise around (0,0).
90 degrees clockwise rotation matrixPoint Matrix=Multiplication =New Matrix
90 degrees anti-clockwise rotation matrixThis transformation matrix rotates the point matrix 90 degrees anti-clockwise. When multiplying by this matrix, the point matrix is rotated 90 degrees anti-clockwise around (0,0).
90 degrees anti-clockwise rotation matrixPoint Matrix=Multiplication =New Matrix
y=-x reflection matrixThis transformation matrix creates a reflection in the line y=-x. When multiplying by this matrix, the point matrix is reflected in the line y=-x changing the signs of both co-ordiantes and swapping their values.
y=-x reflection matrixPoint Matrix=Multiplication =New Matrix

Return to the Top of the Page

Matrix Enlargements

The enlargement of a matrix can be achieved through matrix multiplication of a transformation matrix followed by a point matrix: [T][P]=[N]
The section 2D Reflections and Rotations shows how transforming with the identity matrix, doesn't appear to alter the co-ordiantes of the point matrix. This is due to:

eg.
2 x 2 identity matrixPoint Matrix=Multiplication =New Matrix

However, if the one's in this transformation matrix, were not ones and were another integer number, then the value of the new point matrix would be an enlargement of that integer number, on the original matrix. This is because the new x co-ordiante is the old one multiplied by T1,1 and the new y-co-ordinateis the old one multiplied by T2,2. This means that the identity matrix really performs an enlargment of scale factor 1.

Below are some examples of transformation matrices which enlarge point matrices:

Transformation MatrixAffect of Transformation Matrix
on Point Matrix
Example
Enlargement MatrixThis transformation matrix is the identity matrix multiplied by the scalar 6. When multiplying by this matrix, the point matrix is enlarged by a factor of 6 in the x and y directions.
Enlargement MatrixPoint Matrix=Multiplication =New Matrix
Enlargement MatrixThis transformation matrix is the identity matrix but T1,1 has been larged by a factor of 7 and T2,2 has been enlarged by a factor of 0. When multiplying by this matrix, the x co-ordinate is enlarged by a factor of 7, whilst the y co-ordinate is enlarged by a factor of 0.
Enlargement MatrixPoint Matrix=Multiplication =New Matrix
Enlargement MatrixThis transformation matrix is the identity matrix but T1,1 has been larged by a factor of a and T2,2 has been enlarged by a factor of b. When multiplying by this matrix, the x co-ordinate is enlarged by a factor of a, whilst the y co-ordinate is enlarged by a factor of b.
Enlargement MatrixPoint Matrix=Multiplication =New Matrix
Enlargement MatrixThis transformation matrix creates a rotation and an enlargement. When multiplying by this matrix, the point matrix is rotated 90 degrees anticlockwise around (0,0), whilst the x xo-ordinate of the new point matrix is enlarged by a factor of -5 and the y co-ordinate of the new point matrix is enlarged by a factor of 7.
Enlargement MatrixPoint Matrix=Multiplication =New Matrix

The table above shows that it is the position and sign of elements in a rotation or reflection transformation matrix that decides the rotation or reflection of the point matrix and not the value of the elements as enlarging the value of an element in a rotation matrix only enlarges the rotation. Enlarging a point matrix by a factor in either the x or y direction requires that the non-zero elements of the transformation matrix be enlarged by that factor.

Return to the Top of the Page

Valid CSS!