You are on page 1of 6

10/7/13

Matrix Transformations

Matrices Homepage The Matrix Basic Matrix Arithmetic Matrix Transformations Sources and References Bath University Homepage

Matrix Transformations
Matrix Transformations 2D Matrix Rotations and Reflections Matrix Enlargements

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: [T] is the transformation matrix [P] is the point matrix being transformed [N] is the new transformed point matrix 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:

is the form

Therefore, 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:
people.bath.ac.uk/sej20/transform.html

This transformation matrix will affect a reflection in the line


1/6

10/7/13

Matrix Transformations

y=x for the point matrix, as shown in the example below:

Transformation Matrix Point Matrix

Multiplication

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: [T] is the transformation matrix [P] is the point matrix [N] is the new matrix 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: Affect of Transformation Transformation Matrix Matrix on Point Matrix This transformation matrix is the identity matrix. When multiplying by this matrix, the point matrix
people.bath.ac.uk/sej20/transform.html

Example

=
2/6

10/7/13

Matrix Transformations

is unaffected and the new matrix is exactly the same as the point matrix.

This 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. This 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. This 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. This 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. This transformation matrix rotates the point matrix 90 degrees clockwise. When multiplying by this matrix, the point matrix is rotated 90 degrees
people.bath.ac.uk/sej20/transform.html

3/6

10/7/13

Matrix Transformations

clockwise around (0,0). This transformation matrix rotates the point matrix 90 degrees anticlockwise. When multiplying by this matrix, the point matrix is rotated 90 degrees anticlockwise around (0,0). This 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 coordiantes and swapping their values. 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: the new x co-ordinate being constructed of the old x co-ordinate multiplied by one added to the old y co-ordiante multiplied by zero the new y co-ordinate being constructed of the old y co-ordinate multiplied by one added to the old x co-ordiante multiplied by zero eg.

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: Affect of Transformation Transformation Matrix Matrix on Point Matrix This transformation matrix is the identity matrix multiplied by the
people.bath.ac.uk/sej20/transform.html 4/6

Example

10/7/13

Matrix Transformations

scalar 6. When multiplying by this matrix, the point matrix is enlarged by a factor of 6 in the x and y directions. This 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. This 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. This 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 xoordinate 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.

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
people.bath.ac.uk/sej20/transform.html 5/6

10/7/13

Matrix Transformations

enlarged by that factor. Return to the Top of the Page

people.bath.ac.uk/sej20/transform.html

6/6

You might also like