2d Transformation Examples
2d Transformation Examples
Do, Co
.
D,
Ag s Bo
D3
B
D, B,
|Az
(c) Rotation about origin (d) Reverse translation ant
rectangle moves back to its
original position
In matrix form. it can be shown as
cos, sin 0)
(ii) Rotation: -gin 9 Cos 0
1
original pösition
(iii) Translation: Moves the imäge back to its
1 0
1
is
Now combined transformation matrix
0 coS0 sin ð 0]| 1 0 01
0 1 0 -sin9 cos 0 1
[x y' 1]= y 1] 1
0 cos sin 01
|1
-sin 0 COs 0
1
1
sin 0
-sin 0 cos 0
= y 1]
-*, cOs0+), sih+* -t, sin - Y, cos0 +y,
cOs sin
cos
So,
-x (os 0=1)+ y; sindy,.(cos-1)÷x, sino 1
P, (Xy)
A B
(0,0) P,(0,0)
P,(x.y)
P1
.1 0|| S, 0 0
1 0 0
1 0 0
x,(1-S,) y.(1-S,) 1
8.5.4. Reflection Through an Arbitrary Line these
We have already discussed reflection through the line x = 0, y = 0, y =*, =-. AAll
neither
that
lines pass through origin. But when reflection is to be performed about aline the
using
passes, through the origin nor is parallel to the co-ordinate axis can be solved
following steps:
Step-l: Translate the line and the object so that the line passes through the origin.
Step-2: Rotate the line and the object about the origin until the line is coincident with
one ofthe coordinate axis about which we are famniliar to perform reflection.
Step-3: Refect the object through the co-ordinate axis.
Step-4: Apply the inverse rotation about the origin to shift the line at translated position.
Step-5: Apply inverse translation to send back the object (i.e., line) to its original position.
In matrix rotation
y =
m x + c
D
4Y
D-
A---p A----B,
2
(o,0) X
ABCD:Original object
A'B'C'D':Object after reflection
about y = mx +C (a) After translation by c. (b) After rotation by -0
Ba -,4
X
A' B
Ag
A D4
B3
(C) After retlection about x-axis / (d) After reverse rotation by 0 (e) After reverse translation by c
Fig. 8.15.
EXAMPLE 8.3.
it square is transformed by a 2 x2 transformation matrix, The resulting position
Vectors are
what is the transformation matrix?
Solution: Suppose the unit square have coordinates
(, y)
(x + 1, y)
(c + 1, y + 1)
(, y + 1) )
a C
and let the transformation matrix be
0 2 8 6
So, 034 1 b d y+1 y+1
J2 (V2+2/2
1 1 V2-2/2
(24 4
Atpiáhgle is defined by 2 4
EXAMPL6.6
Tyanslate the square ÁBCD whose co-ordinate arë A(0, 0), B(8, 0), C(3, 3), and D(0, 3) by 2
nits in both directions and then seale it by-1,5 units in direction and 0.5 units in y
direction.
Solution: Hene first operation is translation and second operation is
T, = 2 and T, = 2 ngaling.
'1 01 0 0 7
Translation matrix = 1 =0 1 0
2 2 1 3}
Q 0 11
3 0.
Square ABCD in matrix form =
3
Performing translation operation, we get
[2 2 1]
|1 0 0|
3 0 1 5 2 1
0 1 0
3 3 1 55 1
|2 2 1
|0 3 2 5 1
64
(2, 5) (5, 5)
5+ 5+ D
4+
Translation 3
2+ 2+ A B
1+ (2, 2) (5, 2)
A
(0, 0)| 12 3 4 5 6 7 (0, 0)| 12 3 4 5 6 7
Fig. 8.16.
Now the 2nd operation is scaling so S, = 1.5 S, = 0.5
S, 1.5
and scaling matrix = 0 S, 0 0.5 0
0 1 1
After scaling we will get
|2 2 1 3 1 1
1.5 0 0
5 2 1
7.5 1 1
0.5 0.
5 5 1 7.5 2.5 1
0 1
2 5 1 3 2.5
DI2, 5) C(5, 5)
0
2 2
cos45° -sin 45°
sin 45° cos 45°
V2 V2 0
RA_o = 2 2
0 1
Now find the co-ordinates A B C of the rotated triangle ABC can be found as
3\2
0 0
2 2 2
01 5 (0 1 5)
[A B C] = R4s® 0 1 2 0 01 2 0 V2
2 2
11 1 1 1 1
0 0 1 1 1
2 -1
2 2 (0 1 5
1 1 1 1
-1 -1
/AMPLE 8.8.
c-2-.-1)
Find the
isreducedtransformation matrix that transforms the square
to half of its size, ABCD whose center is at (2,2)
ABCD are A(0, 0) B(0, 4) C(4,with center still remaining at (2, 2). The
co-ordinates ofcoordinates
4) and D(4, 0). Find of square
Solution: Square ABCD in matrix form as the new square.
0 0 1
0. 4 1
4 4 1
4 0 1
We have to rotate sauare ABCD about point A(1, 0). We first translate square ABCD by
1=-1and T, = 0 i.e.,
1 0 1) 0 0 1
00
00 l -1 0 1
1 0
0 1 1 -11 1
-1 01 1 1 1 0 1_1
Now we rotate in clockWIse 0 = 45°
1)
1
1
COs 45° -sin 45° o)/0 0 1) V2 0 0 1)\ 1
-1 0 1 1 1 -1 0 1
sin 45° COs 45° 0 0 W2 1
-1 1 1 -1 1 1
1 1
0 1 1 0 1 1
Now, we translate square ABCD back to its position T, = 1 & T, =0 i.e.,
0 1
l(1 0 o) 1 0 1
1
0 1 0 1-1/W2 /W2 1
0 /2 1 1 V2 1
|1 0 1
/2 1/42 1) 1+1/42 1/N2 1)
Mágnify the triangle with vertices A(0, 0) B(1, 1) and C(5, 2) to twice its size while L
C(5, 2) fixed.
Solution: First we write the required transformation matrix.
1 0 52. 0 0)1 0 -5) (2 0 -5
0 1-2 0 2 0|0 1 -2 = 02 -2
0 0 0 0 1]o 0 1 0 0 1
Triangle ABC in matrix form as follows
0 1 5)
0 1 2
11 1
Now, the new transformation matrix
(2 0 -5)(0 1 5 (-5 -3 5)
02 2||0 1 2 -2 2
0 0 1 J1 1 1 1 1 1
i.e., the new co-ordinates after
A ’(-5, -2) transformation are
B’ (-3, 0)
C’ (5, 2)
EXAMPLE 8.11.
Prove that
two-dimensional rotation and scaling
Solution: The commutative if S, = S,, or o direction.
cos
transformation matrix for
sin 0 0
rotation about origin in anticlockwise
-sin cos 0 0 0
and scaling matrix is 0 S., 0
0
0 1
To prove commutative
R.S = S.R property holds for S.,= S,
cOs0 sin0
i.e., R.S = -sin0 COs 0
(S, 0 0 S, cos0 S. sin 0)
0 S, 0 -S, sin 0 S. cos0 0
0 1 0 0 1
Cos sin 0 S, cos S. sin 0 0
S.R. = 0 S,
-sin cos 0 -S, sin 0 S, cos 0
0 1 0 1
0
S.R
Thus R.S =
n
Now for 6 =
Sin nL
COS nTT 0
(S,
R.S = sin nL COS nL 0 0 S,
0 0 1
1 0 0
(S, (S,0 S, 0
01 0 S, 0
0 0 1 1 0 0 9
0 cos nT Sin nt 0
S
S.R = 0 S, 0 -sin nT COS nTt
0 0 0 1
1 0 0) (S, 0 0
S,
0 S, 0
0 S, 0 0 1 0
0 1
1 00 1
Thus RS = SR if S. = S,, or 0 = nn
EXAMPLE 8.13.
Show that the 2 x 2 matrix
|1 2t
1+t 1+t
[T] = -2t 1-c represents pure rotation.
Ll+2 1+t|
Solution: We know that for pure rotational
matrix is always equal to 1. transformation determinant of the transformatio
12
So, the determinant of [T]= 1-2 2t (1-y2 4t (1-y +s
1+? +
(1+²)2 (1+ 2 (1+
1-2 +t +42 (1+²)² =1
(1+y (1+?
EXAMPLE 8.14.
Show that a 2D reflection through X axis followed by
- x is a 2D reflection through
equivalent to pure rotation about the origin.
the line )=
about origin.
EXAMPLE8.15.
167
that
Show knansformation
relative to the y axis
matrix for a
reflection about y=- x to reflection
followed by a is equivalent
counter clockwise rotation by 90°.
0 -1 0
Solution: Transformation matrix for reflection about
liney=-x is -1 O
0 1
(-1 0 0)
ransformation matr1x for reflection relative to y axis is 1 0
) 0 1
and the transformation matrix for counterclock wise rotation is
cos sin 9
-sin cos 0
0 1
Here, 0= 90°
cOs 90°. sin 90° 0 0 1 0
So, -sin 90 cos 90° 0 =| -1 0 0
1 0 0 1
When applied successively, we get
(-1 0 1 0 0 -1 0)
1 -1 0 0 -1 0 0
0 0 1 0 0 1 0 1
Which is equal to the transformation matrix for reflection about line y =-x.
EXAMPLE 8.16.
Amirror is placed vertically such that it passes through the points (10, 0) and (0, 10). Find
Une reflected view of triangle ABC with coordinates A(5, 50), B(20, 40) C(10, 70).
Solution: We plot the mirror passing through (0, 10) and (10, 0)
10
From igure we easily get tan 0 = = 1, which implies that 9 = 45°
10
To make the line coincident with the x-axis we first translate it to make it pass through
origin and thenrotate it by 0= 45° about origin.
Co-ordinates of triangle ABC in matrix form is
5 50 1
(0,10)
20 40 1
10. 70 1 -Mirror
We
tramslate mirror, so that it passes through origin.
t,=0 t, =- 10
(10,0)
Fig. 8.18.
1 0
T =0 1 0
0 -10 1
Immediately we writeinverse transformation matrix for translation by t=0 and
[1 0 01
1=0 1
|0 101
Now we rotate the mirror by 45° anticlockwise so that it matches with origin
1
1 1 1
(1 00
1 1 1 1
0 1 0
0 10 1
10 10 0
0 -1 0)T1 0 0 0 -1 0
-1 0 00 1 0 -1 0 0
10 0 1|0 10 1 10 10 1
C(4,3)
(0,2) B(5,2)
A(4,1)
(-8/3,0) 2 3 4 5 6 7 8
Fig. 8.19.
i ow thecomposite transformation matrix [7] or
reflection about the lino vwbich does
not pass through origin is
1 1 0 0)
0 1 (T =0 1 0
0-2 1 |0 2 1
COs sin 0
-sin 0 cOs (-0) sin (-0) 0
cos 0
(Rg-1 -sin (-0) cos (-0) 0
1
cos -sin 0 0
(R,)- = sin cOs 0
0 1
4
5
5 5 |1 0 0 4
1 0 0
3 -1 0 5
1 0 5
0 5 5 1/0: 0 1 2 1
| 0 -21
4 3
0 5
5 5
5
0 3 4
T1 3
1 5 5
-2.1 0 1 0 2 1
7 24 7 24
25 25 25 25
1 0 0
24 7 24 7
0 1 0 0
25 25 25 25
|0 -2 11
0 2 1 48 64
1
25 25
7 24 52 39
25 25 25 25
4 1 1
24 35 70
5 2 1 0 1
25 25 25 25
4 3 1
48 64 4 53
1 l
25 25 |25 25
35 70
B’ 25 25
4 53
C’25'
25 25
arn
o l!dh a s