Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Chapter 5

Chapter 5: Transformations with Matrices

Introduction

Consider a point  x y  . We shall call such a point an object.

In this chapter we are interested in transforming an object into an image, denoted  x' y'  ,
where the dashes indicate that a transformation has occurred.
Our imagination tells us there are many ways to transform an object into an image. As a simple
example, consider your current position to be the object and your home to be the image. There
are many ways in which you can travel from your current position to home.
Applying a transformation to an object can be described by a matrix equation. The matrix
transformation equations we consider will be of the form

x' = a b x
y' c d y

where x represents the object, x' the image, and a b the transformation matrix, where
y y' c d

a b c and d are constants.

Note: Transformations are also known as mappings.

Computer Generated Graphics.


Transformations are used in a wide range of applications. For example, you may
have seen computer generated graphics on television or in the movies. There may be
a rotating sphere, the dilation (enlargement) of a piece of fruit, or simple motion
about the screen. Each of these special effects is made up of a sequence of discrete
pictures, mathematically generated by a computer which applies a sequence of trans-
formations on the constituent points of the original object. In order to create images
which appear to move continuously a very large number of transformations are
applied, each producing a slight change in the object.

1
Chapter 5

Transformation Types

Below we examine a variety of transformations and their associated matrices.

Reflection in the x axis

Consider the following diagram.


y

P  x y 

P'  x' y' 

Here the point P  x y  (the object) has been reflected in the x axis (transformed) to the point

P'  x' y'  (the image).


The x coordinates are equal but the new y coordinate is minus the old y coordinate, so that we
have
x' = x
y' = – y
which can be represented by the matrix equation

x' = 1 0 x
y' 0 –1 y

Multiply out this matrix equation to confirm the equations above.

2
Chapter 5

Reflection in the y axis

Consider the following diagram.


y

P  x y 
P'  x' y' 

This transformation may be represented by the following matrix equation:

x' = – 1 0 x
y' 0 1 y

Reflection in the line y=x

Consider the following diagram.

y y = x

P'  x' y' 

P  x y 

3
Chapter 5

This transformation may be represented by the following matrix equation:

x' = 0 1 x
y' 1 0 y

Reflection in the line y=mx

Consider the following diagram which illustrates the reflection of the object in a line y = mx .

You should recall that m is the gradient of the line and is related to the angle (  ) that the line

makes with the positive direction of the x axis by

m = tan 
Also, note that such a line passes through the origin.

y y=mx

P'  x' y' 

P  x y 

O x

This transformation may be represented by

x' = cos 2 sin 2 x


y' sin 2 – cos 2 y

4
Chapter 5

Rotation about the Origin

Consider the following diagram which illustrates an anticlockwise rotation about the origin by
an angle  .
y

P'  x' y' 


P  x y 

O
x

Such a transformation may be represented by the matrix equation

x' = cos  – sin  x


y' sin  cos  y

Note: If  is negative then the rotation is clockwise.

Example 1

Use a matrix method to rotate the unit square --- radians anticlockwise about the origin. Sketch
2
both the object and the image.

5
Chapter 5

Solution
y

B  1 1 
C  0 1 

Object

O A  1 0  x

Applying the transformation

x' = cos   2 – sin   2 x = 0 – 1 x


y' sin   2 cos   2 y 1 0 y

to OABC we get

O  0 0  : x' = 0 – 1 0 = 0 O  O
y' 1 0 0 0

A  1 0  : x' = 0 – 1 1 = 0 A  1 0   A  0 1 
y' 1 0 0 1

B  1 1  : x' = 0 – 1 1 = – 1 B  1 1   B  – 1 1 
y' 1 0 1 1

C  0 1  : x' = 0 – 1 0 = – 1 C  0 1   C  – 1 0 
y' 1 0 1 0
y

B  – 1 1  A  1 1 

Image

C  – 1 0  O x

6
Chapter 5

Note that the resulting image has the same shape and size as the object. Transformations which
preserve shape and size are called isometries. Each of the transformations studied so far are
isometries.

Dilation/Contraction by a factor k parallel to the x axis

Consider the following diagram.


y

P  x y  P'  kx y 

Here the y coordinate is unchanged but the x coordinate is stretched by a factor k to a new

coordinate of kx , so that we have

x' = kx
y' = y
which may be represented by the matrix equation

x' = k 0 x
y' 0 1 y

where k is called the dilation (or contraction) factor.

A dilation, or a stretch, occurs when k  1 and a contraction, or a shrink, when 0  k  1 .

7
Chapter 5

Dilation/Contraction by a factor k parallel to the y axis

Consider the following diagram.


y P'  x ky 

P  x y 

Such a transformation may be represented by

x' = 1 0 x
y' 0 k y

where k is the dilation (or contraction) factor.

Dilation/Contraction parallel to both x and y axes

Consider the following diagram.


y

ky y P'  k x x k y y 

P  x y 

kx x x

The appropriate matrix equation here is

x' = k x 0 x
y' 0 ky y

where k x and k y are the dilation (or contraction) factors parallel to the x and y axes, respec-

tively.

8
Chapter 5

Example 2
Transform the unit square by a dilation of factor 3 parallel to the x axis and a factor 2 parallel to
the y axis. Sketch both the object and the image.

Solution
y

C  0 1  B  1 1 

Object

O A  1 0  x

Applying the transformation

x' = 3 0 x
y' 0 2 y

to OABC we get

O  0 0  : x' = 3 0 0 = 0 O  O
y' 0 2 0 0

A  1 0  : x' = 3 0 1 = 3 A  1 0   A  3 0 
y' 0 2 0 0

B  1 1  : x' = 3 0 1 = 3 B  1 1   B  3 2 
y' 0 2 1 2

C  0 1  : x' = 3 0 0 = 0 C  0 1   C  0 2 
y' 0 2 1 2
y
B  3 2 
C  0 2 

Image

O A  3 0  x

9
Chapter 5

Note that the resulting image in Example 2 does not have the same size as the original object.
Thus, in general, a dilation mapping is not an isometry.

The following table summarises the different kinds of transformations learned so far.

Transformation Matrix Equation


Reflection in the x axis
x' = 1 0 x
y' 0 –1 y

Reflection in the y axis


x' = – 1 0 x
y' 0 1 y

Reflection in the line y=x


x' = 0 1 x
y' 1 0 y

Reflection in the line y=mx


x' = cos 2 sin 2 x
(where m = tan  )
y' sin 2 – cos 2 y

Rotation about the origin


x' = cos  – sin  x
y' sin  cos  y

Dilation/Contraction parallel to x axis


x' = k 0 x
y' 0 1 y

Dilation/Contraction parallel to y axis


x' = 1 0 x
y' 0 k y

Dilation/Contraction parallel to x and y axes


x' = k x 0 x
y' 0 ky y

Note that a transformation is not required to fall into one of the above categories, as illustrated
in the following example.

10
Chapter 5

Example 3

Given the transformation matrix 1 4 find the image of


3 2

(a) the point (2,5), and


(b) the line with equation y – 2x – 1 = 0

Solution

(a) x' = 1 4 2 = 22  2 5    22 16 


y' 3 2 5 16

(b) Our aim is to find an equation in the variables x and y .

1
Rearranging x' = 1 4 x we get x = --------- 2 – 4 x
y' 3 2 y y – 10 – 3 1 y

or
1 1
x = ---------  2x – 4y  and y = ---------  – 3x + y  .
– 10 – 10
Substituting into y – 2x – 1 = 0 gives

1- 2
--------  – 3x + y  + ------  2x – 4y  – 1 = 0
– 10 10
– 3x + y – 4x + 8y + 10 = 0
9 y – 7x + 10 = 0
Therefore, y – 2x – 1 = 0  9y – 7x + 10 = 0

Combined Transformations

Consider a transformation represented by a matrix A followed by a transformation represented

by a matrix B . When such a combined transformation is applied to an object P  x y  the

image P''  x'' y''  is given by

x'' = BA x
y'' y

It is important to remember this order of multiplication. Can you think why?

11
Chapter 5

Note that we have used double dashes in our notation to denote that two transformations have
occurred.

Example 4
Find the image of the point (2,3) under

(a) a rotation of --- radians followed by a reflection in the x axis.
2


(b) a reflection in the x axis followed by a rotation of --- radians.
2

Solution
(a) Second First
transformation transformation
(reflection) (rotation)

x = 1 0 cos   2 – sin   2 2


y 0 – 1 sin   2 cos   2 3

= 1 0 0 –1 2 = 1 0 –3 = –3
0 –1 1 0 3 0 –1 2 –2

 x y   x y   x y 

Therefore, under this combined transformation we have  2 3    – 3 – 2  , as illustrated


below.
y
P  2 3 
3
P  – 3 2 
2

-3 O 2 x

-2
P  – 3 – 2 

12
Chapter 5

(b) Second First


transformation transformation
(rotation) (reflection)

x = 0 – 1 1 0 2 = 0 – 1 2 = 3
y 1 0 0 –1 3 1 0 –3 2

 x y   x y   x y 

Therefore, under this combined transformation we have  2 3    3 2  , as illustrated below.


y
P  2 3 
3
P  3 2 
2

O 2 3 x

-3 P  2 – 3 

Note that changing the order of transformations has resulted in a different image.

Degenerate Transformations

In Example 3 (b) we saw that the image of the given line was another line. This is not always
the case.

Example 5

Find the image of the line y = – 2x + 2 under the mapping 2 1 .


4 2

13
Chapter 5

Solution

Here we have x = 2 1 x
y 4 2 y

Note that the transformation matrix is singular (  = 0 ), meaning we cannot solve for x , as
y

we did in Example 3 (b).


Instead, we will substitute the equation of the line into the matrix transformation equation.

That is, x = 2 1 x = 2
y 4 2 – 2x + 2 4

Therefore, y = – 2x + 2   2 4 
Note that the object is a line, but the image is a point.

Such a transformation is called a degenerate transformation.


Under degenerate transformations certain straight lines degenerate into points.
Degenerate transformations are easy to recognise since the transformation matrix of a degen-
erate mapping is singular.

Example 6
Determine whether or not the following matrices represent degenerate transformations. Give a
reason for your answer.

(a) 1 2 (b) 1 1
36 1 2

Solution
(a)  = 0 . Therefore, we have a degenerate transformation.

(b)  = 1  0 . Therefore, our transformation is not degenerate.

14
Chapter 5

Example 7
In example 5 we saw a line map onto a point under a degenerate mapping. Are there other lines
that degenerate into points under the same mapping?

Solution
Let’s substitute the equation of a line, y = mx + c , into the matrix transformation equation

x = 2 1 x
y 4 2 mx + c

Therefore,
x =  2 + m x + c

y = 2  2 + m x + 2c

The line will degenerate into a point when 2 + m = 0 , or m = – 2 .

That is, lines of the form y = – 2x + c   c 2c  .

References
• Elementary Linear Algebra (Fourth Edition), S. Venit and W. Bishop (Brooks/Cole 1996).
• Linear Algebra and its applications, D. C. Lay (Addison-Wesley 1994).
• The MacTutor History of Mathematics Archive, www-groups.dcs.st-and.ac.uk/~history/
• Elementary Linear Algebra, S.I. Grossman (Saunders 1994).

15

You might also like