0% found this document useful (0 votes)
48 views20 pages

2d Transformation Examples

The document outlines methods for performing geometric transformations such as rotation, scaling, and reflection about arbitrary points. It details the steps involved in translating objects to the origin, applying transformations, and then translating them back to their original positions. Additionally, it provides examples and transformation matrices for various operations, illustrating the mathematical principles behind these transformations.

Uploaded by

anshul.saini1507
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views20 pages

2d Transformation Examples

The document outlines methods for performing geometric transformations such as rotation, scaling, and reflection about arbitrary points. It details the steps involved in translating objects to the origin, applying transformations, and then translating them back to their original positions. Additionally, it provides examples and transformation matrices for various operations, illustrating the mathematical principles behind these transformations.

Uploaded by

anshul.saini1507
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

6 .

Rotation About an Arbitrary Point


We discussed earlier about rotation, which occurs only about the
is torotate the object about a point other than origin. For this
origin but now our aim
purpose
system will provide a method to accomplish rotation about any point. homogeneous coordinate
This can be done in the
following order:
Step 1: Translate the object or body at the origin (translation)
Step 2: Rotate by any angle as given (Rotation)
Step 3: Translate back to its original location (inverse
translation).

Do, Co
.
D,
Ag s Bo

(a) Rectangle A, B, CD, to A,(0,0) B


bê rotáted about plvot point (b) Rectangle is translated by
(-Xe Y) so that A, becomes
origin i.e., (0, 0)
C

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

where T ’ Translation matrix


Ro ’ Rotation matrix by an angle e°
[T ’ Inverse translation matrix.
Jet us obtain transformation matrix for anticlockwise rotation about point (ç Y
() Translation: Moves ( Y)to origin t, - x, t, = - y.
1
1 0

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

8.3.3. General Fxed-Point Scaling But sometimes


The scaling about the origin.
matrix discussed previously perforths scaling objects position.
may be required to perform scaling without altering the
4y

P, (Xy)
A B

(0,0) P,(0,0)

(a) Original position of the object (b) Translation of objet so that P,


which want to be scaled about its coincides with origin.
centroid P,

P,(x.y)
P1

(c) Scaling of object w.r.t. origin (d) Reverse translation of scaled


object such that P, returns to
its initial position
Fig. 8.14.
Thus, following three steps will have to, be followed
1. Translate point to origin
2. Perform scaling
3. Inverse translation
1 01| S, 0110
Hence, 0 1
[T] =
-eye 1
Sy 0 1
1

.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

where T ’ Translation matrix


Ro ’ Matrix for rotation by angle
Rof ’Reflection about any axis
[Ral’ Inverse rotation
[TR’ Inverse translation

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

ax +cy a(x+1)+ cy a(x+1) +e(y+1) ax +c(y +1) )


bx +dy b(x +1)+ dy b{x+1) +d(y+1) bx+d(y+1) )
ax+ cy = 0
Now
bx +dy = 0 ..)
a(x +1) +cy =2|
b(x +1) + dy =3 ...)
a(*+1) +c(y +1) =8)
b(x +1) +d(y +1) =4| ...ü)
ax + c(y+1)=6
bx +d(y+ 1) =1) ...(0)
From (i) & (iü) we get a= 2, b = 3.
From (iii) & (iv) we get c =6d =1

Thås, the transformation matrix is 2 6


81
EXAMPLE 8.4.
(a) Fjnd the matrix that
are the new represents rotation of an object by 45° aboat the
coordinates of the point P(2, 4) after the origin.
rotation?
cOs 450
Solution: () -sin 45 V2 V2
sin 45° Cos 450
(6) The new co-ordinates can be found by
1

J2 (V2+2/2
1 1 V2-2/2

(24 4
Atpiáhgle is defined by 2 4

Find the transformed coordinates after the following transformation


(i) 90° rotation about origin
(ii) reflection about line y = ,
Solution: () After 90° rotation about origin, the transformed coordinate are
cos 90° -sin90º 0)/2 4 4
sin 90° cOs 90° o2 2 4
1 1 1 1
(0-1 0 2 4 4 -2 -2. -4)
4 =2 4 4
=1 0 0|2 2
1 1 1 1 1
0 0
Finally after refilection about line y =- x, the transformation matrig is
0 -1 0||-2 2-41 J-2 -4 -4|
-1 0 0oll 2 4 4 = 2 2 -4
1 1 1
14|1 1

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)

Scaling 4 D(3,2.5) C(7.5, 2.5)


2+ 3+
1 A(2, 2) A(5, 2) 2+
A| 1+
(0, 0)1 2 3 4 5 6 7 A(3, 1) B(7.5, 1)
(0, 0) 1 2 3 4 5 6 7 8
Fig. 8.17.
After transformation, new
A(3,1) co-ordinates are
B(7.5, 1)
C(7.5, 2.5)
D(3, 2.5)
EXAMPLE 8.7.
Perform a 45° rotation of triangle A(0, 0), B(1,
about the origin and (b) about 1), C(5, 2) (UPTU 2003)
point P-1, 1).
Solution: Triangle ABC in matrix formn is given as
fo 0o 11] To 1 5
1 1 1 01 2
Or
|5 2 1 1 11
(a) Matrix of rotation is

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

Thus A'= (0, 0)


B = (o2)
3/2 7V2
C= 2 2

(6) The rotation matrix is


2 -1
J2 1 01
2 2
(1 0 -1 2
01 -1 V2
0 1
2 2 (-1)
0 0 1 2 0 0 1 0 1
2
1

2 -1
2 2 (0 1 5

Now, [A' B CT] = 2 2 (a-1) 01 2

1 1 1 1
-1 -1

|(-1) (2-1) 2-1


1 1 1

Thus A'= (v2 -1)


B=(-2N2-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

For reducing square


ABCD to half of its size we scale it by So, scaling
matrix is S. = and S, = 2
1/2
0 S, 1/2 0
0 1
0 1
After scaling we get
0 0 1
1/2 0 0 1
0 4 1 0
0 21
4 41 1/2 0
1 2 21
4 0 1
2 0 1
After scaling the
A = (0, 0) co-ordinates of square ABCD are
B= (0, 2) and now the centre is (1, 1) but 'we want the. centre of ABCD (2, )
Therefore,
C= (2, 2) we
D= (2, 0) translate the square ABCD by T.
=1 and I, 1.
Translation matrix
Ormation.
1 0 0 (1 0 0
0 =0 1 0
Iy 1 |1 1 1
After translation we get
0 0 1 (1 1 1)
10 0
0 2 1 1 3 1
0 1
2 2 1 3 3 1
1 1 1l
2 0 1 3 1:1
Thus, the new CO-Ordinates for square ABCD are
A ’ (1, 1)
B ’ (1, 3)
C’ (3, 3)
D’ (3, 1)
EXAMPLE 8.9.
Consider the square A(1, 0) B(0, 0) C(0, 1) D(1, 1). Rotate the square ABCD by 45° clockwise
about A(1, 0).
Solution: Square ABCD in matrix form as follows.
1 0 1
0 0 1
01 1
1 1 1
Matrix for rotation in clockwise about origin.
cos -sin 0
sin cos
0

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

EXAMPLE8.12. reflection along the K-axis followed


=x is equivalent to the
7he retlection along the line y degrees. Find the value of 0.
clockwise rotation by 0
Uy counter
transformation matrix for reflection about the line y=x is
Olution: The
01 0
...)
1_ 0/0
0 0 1
(1 0\
rotation by 0
-1 0.and for counter clockwise
Keflection about x-axis. the matrix is 0
0 0 1
about origin is
cos sin 0)
-sin 0 cos 0
0 1
application, the resultant transformation is
For successive
sin 0) cos sin 0
1 cos
Sin *-cos 0
-sin cos 0
0 -1 0
1 0 1
0 1
It is given that
cos sin0 (0 1 0
sin -cós 0 1 0 0
0 1 00 1
Le.. cos = 0and sin 0= 1 and - cos = 0’ = 90°

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 )=

Solution: The transformation matrix for reflection 1


about x-axis is 0 -1 0 and reflection
0 1
-1 0)
through y = - x is -1
0
When applied successively, we get
(1 0-1 0 1 0
0 -1 0 -1
- -1 0 0
1
0 1
o
tansformation matrix for rotation about origin by an angle =
cos 270° -sin 270°. 0) 1
270° is
sin 270° cos 270

eneral, if two Pure retlection


apphed successively, the result is a pure transtormation
rotation
about line passiag through the
origin
are

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

cos0 sin 0) cos 45° sin 45° 0


1
-sin cos 0 -sin45° cos 45°
0 0 1

Immediately, we write inverse transformation matrix for rotation by 45°

cos (-45) sin (-45°) 0 V2 V2


R;l =|-sin (-45°) cos 1
(-45°) 0 0
0 1 2
0 1

Transformation matrix for reflection about x-axis is


1 0
Rref = -1 0
0 0 1
The steps are:
1. Translate the
2. Rotate mirror and object so
mirror and
3. Now mirror object by 45° in that it passes
matches with x-axis then
4. Rotate mirror and through origin i.e., T;
anticlockwise
i.e., R
5. Then translate object by 45° reflect triangle ABC
So resultant transformationand object clockwise i.e., R,
mirror about a-axis i.e., Kye
R= T, * R,* Rrefmatrix is back to its
* R * position matrix i.e.,
T-1
1
1
i.e., R= 0 1 1
0 -10 1 J2 0 J2 J2
0
0 0)
1 1
0 1
0 0 10 1
O 2-DTransformation 169
1
1
V2 1 V2
1
1 0 0)
1
0 -1 0 0
W2 V2 0 0 1 V2
10 10 0 10 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

Now, the new co-ordinates for A ABC


0 -1 0 -40 5 1
5 50 1
20 40 1 -1 0 0 -30-10 1
10 70 1 10 10 1 -60 1

Thus after reflection, the new co-ordinates are


A’(-40, 5)
B’(-30, 10)
C’(-60, 0)
EXAMPLE 8.17. equal to the
Ove that simultaneous shearing in both directions (* & y directions) is not
y-axis.
pOsition of pure shear along -axis followed by pure shear along
Solution: We knów the simultaneous shearing
..)
S, =
1 1 0)
Shearing in x-direction is and in y-direction is | 1 Therefore, shearing in x
0 1

direction followed by y-direction is


which js not equal to Eq).
EXAMPLE 8.18.
Show that the composition of two rotations is addítive by cOncatenating the
representations for R(0,) and R(0,) to obtain R(e,)-R(8,) = R(0, + 8,).
Solution: We know the rotation matrix as (UPTU ma20tix3,
cos - sin 0
sin 9 cOs

cos &, -sin , cos @, - sin 0,


So R(0,) sin , cos1 and R(e.) = sin , cos,
cos(e, +6,) -sin(®, +0,)
Then R(0)-R(0,) sin(&, +8,) cos(e, +8,) R(0, + 0,)
R(0,) R(0,) =R(0, + 6.).
EXAMPLE 8.19.
Reflect the triangle ABC about the line 3x 4y + 8 = 0. The position vector of the c0ordinate
ABC is given as A(4, 1), B(5, 2), C(4, 3).
Solution: Equation of line 3x 4y + 8=0
m= = tan 0.
4
3 4
tan = so, sin = COs =
4 5 5
The intersection of the line 3x - 4y + 8 = 0 with
x=0 is y =2 (0, 2)
y=0 is x = -8/3 ’ (-8/3, 0)

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

Reflection about *-axis i.e.,


1 0 0
0-1
Byef 0 0 1

1 0 0 cos sin 0 0|1 0 01 cos. -sin 9 ||1 0 0


0 -sin cos 0||0 -1 0 sin COs0 1 0
(T] = 0 1
1
0 1 0 1||0 2
0 -2
Put the values of cos 0 and sin 0, we get
4
4 3
5
5 5 1
1 0 3 4
3 4 01 0
0 -1 0
0 1 5
[T] = 5 5 1 |0 2 1
0 1
|0 -2 1 0 1 0

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

Matrix for triangle ABC can be written as


A| 4 1 1
B5 2 1
C|4 3 1
The reflected co-ordinates can be calculated as follows.

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

Thus the reflected co-ordinates


52 39
A ’
25 25

35 70
B’ 25 25

4 53
C’25'
25 25
arn
o l!dh a s

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy