Transformations and Matrices
Transformations and Matrices
Transformations and Matrices
Introduction to Transformations
- Matrices can be used to represent many transformations on a grid (such as reflections, rotations,
enlargements, stretches and shears).
- To find the image of a point P, you multiply the matrix by the position vector of the point.
Example: A transformation is represented by the 2 by 2 matrix M =
2 1
1 1
| |
|
\ .
.
To find the image of the point (3, 2) under this transformation, you need to find the result of the
following matrix multiplication
position
matrix
vector
2 1 3 8
1 1 2 1
| | | | | |
=
| | |
\ . \ . \ .
So the coordinates of the image are (8, -1).
Example 2: A rectangle has coordinates (1, 1), (4, 1), (4, 3) and (1, 3). Find the coordinates of the
image of the rectangle under the transformation represented by the matrix
3 1
1 1
| |
|
\ .
.
Solution:
You could find the image of each vertex in turn by finding
3 1 1
1 1 1
| || |
| |
\ .\ .
,
3 1 4
1 1 1
| || |
| |
\ .\ .
etc.
However, it is more efficient to multiply the transformation matrix by a rectangular matrix
containing the coordinates of each vertex:
transformation matrix containing
matrix coordinates of each vertex
3 1 1 4 4 1 2 11 9 0
1 1 1 1 3 3 0 3 1 2
| | | | | |
=
| | |
\ . \ . \ .
.
So the image has coordinates (2, 0), (11, -3), (9, -1) and (0, 2).
The diagram below shows the object and the image:
2 4 6 8 10 12
0
2
4
6
-2
-2
Page 2 of 8
1 2 3
1
2
3
0
Any transformation that can be represented by a 2 by 2 matrix,
a b
c d
| |
|
\ .
,
is called a linear transformation.
Transforming the Unit Square
The square with coordinates O (0, 0), I (1, 0), J (0, 1) and K (1, 1) is called the unit square.
Suppose we consider the image of this square under a general linear transformation as represented
by the matrix
a b
c d
| |
|
\ .
:
0 1 0 1 0
0 0 1 1 0
a b a b a b
c d c d c d
+ | || | | |
=
| | |
+
\ .\ . \ .
.
We therefore can notice the following things:
- The origin O (0, 0) is mapped to itself;
- The image of the point I (1, 0) is (a, c), i.e. the first column of the transformation matrix;
- The image of the point J (0, 1) is (b, d), i.e. the second column of the transformation matrix;
- The image of the point K (1, 1) is (a + b, c + d), i.e. the result of finding the sum of the entries in
each row of the matrix.
Example:
Find the image of the unit square under the transformation represented by the matrix
1 2
0 1
| |
|
\ .
.
Solution:
The image of (1, 0) is (1, 0) (i.e. the first column)
The image of (0, 1) is (2, 1) (i.e. the second column)
The image of (1, 1) is (3, 1) (i.e. add the entries in the
top row and the bottom row together).
We can show the unit square and its image in a
diagram:
We notice that the points on the x-axis have not moved.
This type of transformation is called a shear. Here the
invariant line is the x-axis.
Page 3 of 8
1 2 3
1
2
3
0
-1
I
I'
J
J'
We can describe what transformation any matrix represents by seeing how it affects the unit square.
Example:
A transformation T is given by:
' 0 1
' 1 0
x x
y y
| | | || |
=
| | |
\ . \ .\ .
.
(a) Find the image of the point A (3, 2).
(b) Describe fully the transformation represented by T.
Solution:
(a) The image of A (3, 2) can be found by:
0 1 3 2
1 0 2 3
| || | | |
=
| | |
\ .\ . \ .
So the image of A is the point A' (-2, 3).
Note: The image of a point A is often denoted A'.
(b) To describe the transformation we consider the image of the unit square:
The image of (1, 0) is (0, 1) (i.e. the first column)
The image of (0, 1) is (-1, 0) (i.e. the second column)
The image of (1, 1) is (-1, 1) (i.e. add the entries in the
top row and the bottom row together).
Finding the matrix to represent a transformation
To find the matrix that defines a transformation
you may find the images of the two points I (1, 0) and J (0, 1).
The image of (1, 0) forms the first column of the matrix.
The image of (0, 1) forms the second column of the matrix.
Example:
Find the matrix that represents a reflection in the y-axis.
Solution:
When you reflect in the y-axis:
- the image of I (1, 0) is (-1, 0)
- the image of J (0, 1) is (0, 1).
Therefore the matrix is:
1 0
0 1
| |
|
\ .
.
I I'
J
J'
1
1
-1
x
y
reflect in y-axis
Page 4 of 8
1
1
0
u
1
cosu
sinu
(cosu sinu ) ,
u
1
cosu
sinu
sinu (- cosu ) ,
Example 2:
Find the matrix that represents an enlargement centre (0, 0), scale factor 3.
Solution:
The image of the point I (1, 0) is (3, 0).
The image of the point J (0, 1) is (0, 3).
So the matrix is
3 0
0 3
| |
|
\ .
.
Example 3:
Find the matrix that represents a rotation centre (0, 0), 90 clockwise.
Solution:
The image of the point I (1, 0) is (0, -1).
The image of the point J (0, 1) is (1, 0).
So the matrix is
0 1
1 0
| |
|
\ .
.
Some Special Matrix Transformations
Rotation through anti-clockwise centre (0, 0).
The matrix that represents this transformation is
cos sin
sin cos
u u
u u
| |
|
\ .
.
Reflection in the line y = mx, where m= tan
The general form for the matrix corresponding to a reflection in the line y = mx is
cos 2 sin 2
sin 2 cos 2
u u
u u
| |
|
\ .
.
0
1 2 3
1
2
3
I I'
J
J'
x
y
0
1 2 3
1
2
I
I'
J
x
y
-1
J'
rotation 90 deg clockwise
Page 5 of 8
Example:
Find the matrix of an anti-clockwise rotation about the origin through 60.
Solution:
This matrix would be
3 1
2 2
3 1
2 2
cos 60 sin60
sin60 cos 60
| |
| |
|
=
|
| \ .
\ .
.
Example:
Find the matrix that corresponds to a reflection in the line y = 2x.
Solution:
Since tan = m = 2, = 63.43.
Therefore the matrix is:
cos(2 63.43 ) sin(2 63.43 ) 0.6 0.8
sin(2 63.43 ) cos(2 63.43 ) 0.8 0.6
| | | |
=
| |
\ . \ .
.
Stretch, scale factor k parallel to the x-axis
The matrix for this transformation is
0
0 1
k | |
|
\ .
.
Note: A stretch is an enlargement is one direction only.
Stretch, scale factor k parallel to the y-axis
The matrix for this transformation is
1 0
0 k
| |
|
\ .
.
Shear parallel to the x-axis
The matrix
1
0 1
k | |
|
\ .
corresponds to a shear parallel to the x-
axis. Points on the x-axis do not move, whilst points on the
line y = 1 are translated k units to the right.
1 k
1
I I'
J
J'
1
1
k
I
I'
J
J'
I
I'
1
1
points on the line y = 1
are translated k units to
the right
Page 6 of 8
Shear parallel to the y-axis
The matrix
1 0
1 k
| |
|
\ .
corresponds to a shear parallel to the
y-axis. Points on the y-axis do not move, whilst points on
the line x = 1 are translated k units up.
Example:
The matrix M is given by
1 1
2 2
1 1
2 2
3
3
| |
= |
|
\ .
M .
(i) Give a complete geometrical description of the transformation represented by M.
(ii) Hence write down the smallest positive integer n for which
1 0
0 1
n | |
=
|
\ .
M .
Solution:
(i) When describing the transformation corresponding to a matrix, it is sensible to first compare the
given matrix to the general matrices for rotation and reflection.
The matrix for rotating through anticlockwise centre (0, 0) is
cos sin
sin cos
u u
u u
| |
|
\ .
The matrix for reflecting in the line y = (tan)x is
cos 2 sin 2
sin 2 cos 2
u u
u u
| |
|
\ .
.
Our matrix
1 1
2 2
1 1
2 2
3
3
| |
= |
|
\ .
M is similar in structure to the matrix for rotation (since the entries on
the leading diagonal (from top left to bottom right) have the same signs and the entries on the other
diagonal have opposite signs).
We therefore have to find the correct value for . We do this by solving
1
2
cosu = and
1
2
sin 3 u = .
Since cos is negative and sin is positive, must be in the second quadrant (between 90 and
180). Solving the equations, we find that = 120.
So M represents a rotation centre (0, 0), through 120 in an anti-clockwise direction.
(ii) Since M represents a rotation through one third of a turn, if you repeat this transformation 3
times you would end up where you started off. Therefore M
3
would represent the identity
transformation (which is represented by the identity matrix). So n = 3.
I
1
1
points on the line
x=1 are
translated k units
up
I'
Page 7 of 8
Combining Transformations
Suppose we have two matrices M and N, each corresponding to a different transformation.
Then the matrix product NM corresponds to the combined transformation, where M is the first
transformation and N is the second transformation.
Note: Look carefully at the order.
Example:
Find the matrix that represents the combined transformation:
- reflection in the x-axis;
- followed by enlargement scale factor 2 centre (0, 0).
Solution:
We first find the matrix that corresponds to each separate transformation.
Transformation 1: Refection in the x-axis:
The image of (1, 0) is (1, 0)
The image of (0, 1) is (0, -1)
So the matrix is
1 0
0 1
| |
|
\ .
.
Transformation 2: Enlargement s.f. 2 centre (0, 0):
This matrix is
2 0
0 2
| |
|
\ .
.
Combined transformation:
Since we wish to reflect first then enlarge, the correct order to multiply the matrices is:
2 0
0 2
| |
|
\ .
1 0
0 1
| |
|
\ .
=
2 0
0 2
| |
|
\ .
Interpreting the Determinant of the Transformation Matrix
Suppose that a transformation T is represented by the matrix M.
When a shape is transformed by this transformation matrix, the area of the image is related to the
area of the object according to this relationship:
Area of image = |det( )| Area of object M .
Therefore |det(M)| represents the area scale factor for the transformation.
Note: If det(M) is negative, then the transformation will have involved some flipping over (i.e.
some reflection is involved).
Example:
The matrix A is given by
1 3
3 1
| |
=
|
\ .
A .
(a) Describe fully a sequence of two geometrical transformations represented by A.
(b) The triangle PQR is mapped by the transformation represented by A onto the triangle PQR.
Given that the area of PQR is 8, find the area of PQR.
1
1
-1
reflect in x-axis
Page 8 of 8
Solution
(a) Consider the image of the unit square under the transformation,
The image of the point (1, 0) is (1, 3), i..e the first column of the matrix
The image of the point (0, 1) is (-3, 1), i.e. the second column of the matrix.
The image of the point (1, 1) is (1-3, 3+1), i.e. the sum of the entries
We can see that two transformations are involved:
The unit square has been enlarged;
The unit square has been rotated.
The length of the sides of the enlarged square are
2 2
1 ( 3) 2 + =
So the scale factor of the enlargement must be 2.
The angle of rotation is the angle shown on the diagram above.
Using trigonometry we find that = 60.
So the two transformations are:
- enlargement s.f. 2 centre (0, 0)
- rotation 60 (anticlockwise) centre (0, 0).
(b) To find the area of the image, we need to find det(A). This determinant is 1 (-3) = 4.
So the area of the image is 4 times the area of the object.
Therefore the area of PQR is 4 8 = 32.
I
J
1
1
3
3
I'
J'
u