0% found this document useful (0 votes)
14 views7 pages

Adobe Scan Jan 12, 2021

The document discusses two-dimensional geometric transformations that can be applied to geometric entities and drawings in computer-aided design, including translation, scaling, rotation, reflection, and shear. Translation moves an entity in the x or y direction. Scaling enlarges or shrinks an entity. Rotation rotates an entity around a fixed point. Matrix representations can be used to combine multiple transformations.

Uploaded by

sourav
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)
14 views7 pages

Adobe Scan Jan 12, 2021

The document discusses two-dimensional geometric transformations that can be applied to geometric entities and drawings in computer-aided design, including translation, scaling, rotation, reflection, and shear. Translation moves an entity in the x or y direction. Scaling enlarges or shrinks an entity. Rotation rotates an entity around a fixed point. Matrix representations can be used to combine multiple transformations.

Uploaded by

sourav
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/ 7

3.

9 TWO GEOMETRIC TRANSFORMATIONS


Any geometric entity or drawing can be manipulated using transformation routines. If a
real drawing has to be produced using a computer, the limitation on size of display screen
poses a problem. There are only fixed number of_pixels on display surface. The device
co-ordinate system for output devices like plotter, CMM etc. in pixels is too restrictive
for many applications. A solid model needs to be rotated to give a
clear picture of
its shape. An engineer can make use of transformation
techniques to ovércome such
difficulties. Transformation-in a-single-planei s called 2D transformation.
here are basically five types of transformation routines
1. Translation
2. Scaling
3. Rotation
4. Reflection
5. Shear
108 Fundamentals of CADIa
V3.9.1 Translation
CADICA
Any graphical entity can be translated or moved in X or Y direction by usino
routine. sing this
Basic equations used in this subroutine are
X = X + T,
Y Y + Ty
(X, Y) are the coordinates after translation and (X, Y) are the old coordinat
new
before translation. T, and T, is the distance to be translated in x and y direction ates
respectivel
The equations can be written in matrix form as

1 0
X Y 1 = [XY1]x| 0 1

7,
0 0
Here matrix 01 0is called the translation matrix.
TT 1
Matrix Representation and Homogeneous Coordinates
The composite transformation (i.e.
can be carried out conveniently
carrying out two or more transformations at a time)
by using matrix representation of transformation
A concept of
homogeneous co-ordinates is used. Every point having routines
be represented in matrix form as coordinates (x, y) can
[X, Y, W1. Here W represents a parameter which defines
class of transformation. The
representation of a coordinate in matrix
called homogeneous coordinates. as shown above is

For all two dimensional


transformations the value of 'W is 1. Hence the
any transformation of a point can be equation of
represented in matrix form as
X Y 1] = [X Y 1]x [Transformation Matrixlg.s
It is obvious that for 2-D
3 x 3.
problems, the dimensions of transformation matrix must be

3.9.2 Scaling
This routine is used to
enlarge the object or make it small.
The basic equations are

X X. S
Y Y.S,
where S, and S, are the scaling factor in x and
image, the value of scaling factor will be y direction respectively. To
greater than one and to diminish an
enlarge an
value of scaling factor will be less than image, the
one.

S 0
Scaling matrix will be 0
Computer Graphics
109

Hon ce the matrix form of equations for


scaling will be
S, 0 0
X Y 1 =[X Y 1] 0 S 0
0 0
when scaling is effected with
respect to some fixed
point (x y), translate point
t o origin, perform scaling, translate the point back to its original position. Hence
nal scaling matrix can be obtained by multiplying the 3 matrices as follows

|1 0 S, o 01 [1 0 01 S, 0 0
0 1 0 x0 S 0 x0 10 0
Sy 0
-0 -h100 1J L» » 1] a-S,)x (-S,)% 1

3.9.3 Rotation
Ratation of any point is effective with respect to some fixed point. We assume anticlockwise
rotation as positive and clockwise rotation as negative. Refer Fig. 3.13.

P'(x, y)

Px,y)

Fig. 3.13. Rotation of a point P to P about Z axis.


From the figure,
X = r cos o
Y = r Sin o
X = r cos (0 + ¢)

= r lcos 6 cos o -

sin 0 sin o|
= (r cos o) cos 6 - (r sin ) sin 0

X = X cos 6 Y sin 0 ...(1)


Also Y = r sin (6 + ¢)

=r lsin 0 cos + cos 0 sin o]


Y ..2)
=
X sin 0 Y cos
Equations (1) & (2) can be written in matrix form as
For rotation of a point about Z-axis)
110 Fundamentals of CAD/CA Computer Graphics
111
Similarly, the final position of point (10, 5) will be
cos sin6
0 a 1 =
[10
1]x [R] 5
X Y 1] =
[X Y 11|-sin cose
0 A triangle having vertices (1, 10), (6, 2) and
EXA (8, 4) is translated by 3
units
tion then it is rotated by 45° in counter-clockwise
direction, then it
Concatenation Rule 3 units in x-direction. Pind out final position of the triangle. is scaled by
Sequences of transformation can be combined into one transformation by the concatenation
Solution
process. 1)Translation matrix when the triangle is translated by 3 units in y-direction, (T,] :
When three transformation matrices are to be concatenated then following rule
followed
A B-C = A.(B.C) = (A B).C 7 = |0 1 o
where A, B and C are transformation matrices.

) Rotation matrix when the triangle is rotated by 45° in


EXAMPLE
when it is
3,4,Find the final position ofthe line having the end points (3, 5) and (10, 6)
thanslated by three units in x-direction and then rotated by_30° in clockwise
anticlockwise direction, R]:
cos 45° sin 45 .707 .707 0
direction. -sin 45
R cos 45 - 7 0 7 .707 0
Solution : Translation matrix when line is translated by 3 units in x-direction is 0
given by
(3) Scaling matrix when the triangle is scaled by 3 units in x-direction, [S,]
1 0 01
IT = 0 1 0 3 0 0]
3 0 1 IS = |0 1 o
L0 0 1
Rotation matrix when the line is rotated by 30° in clockwise direction.
Final transformation matrix [R] is given by
cos (-30) sin-30° 0
R = - s i n (-30) cos-30°
0 0.707
0 1 .707 0
3 0 01
0 1 o-707 .707 0 1 0
fo.866 -0.5
10 o 1
0.5 0.866 0
L0 3 1J[ o

2.121 0.707
Concatenating the matrix [T,] and (R] we have resultant matrix R as -2.121 0.707
IR) -6.363 2.121
=
IT} R
10 0 0.866 Now X Y 1]= X Y 1x R
-0.5

0 x0.5 0.866 o 2.121 0.707


0 1 o 1 = X Y 1x -2.121 0.707 0
-6.363 2.121 1
0.866 -0.5 0
R) 0.5 0.866 Hence, the final position of point (1, 10) is
0
2.598 -1,5 1 2.121 .707
Hence, the final position of point (3, 5) will be 1] 1x -2.121 0.707 0
x =
[1 10
2.121
4 1] =
[3 5
1]x[R] -6.363
Fundamentals or CADCAM
112 C o m p u t e rG r a p h i c s

113
7.07 +2.121)
. = 2.121 2121 6.363, .707
= -25.452. 9.898)
Reflecti trix is given by IR] = 0 10
(5, 2) is
Similarly, the final position of point
00
1] [5 =
2 1 x[R
point (8, 4) i
n ce to find coordnates ol
point P i.e. r, y) about
y-axis
The final position of
1= )
[8 4 1 x[R]

3.9.4 Refiection
1 = x0 1

of an object. Reflection is
0 1
to obtain mirror image
By using this routine, it is possible
always carried out about an axis
called axis of reflections. d Reflection Matrix when the Axis
of Reflection is the Line Passing Through
If the axis of reflection is z-axis then
the r-coordinate of
the
point remains unchange Origin
when the axis of reflection is y-axis Refer Fig. 3.16.
the y-coordinate
Similarly
flips (changes sign).
while remains the same while the r-coordinate changes its e equation of the line passing through origin is y
the y-coordinate of the reflection the slope (m tan 8). =

where m is
mx,
sign. should be taken:
of Point P about r-axis
is P (Refer Fig. 3.14) The following steps
Reflection About z-axis: Reflection R o t a t e the line that 1s axis of reflection y = m,
in clockwise direction by angle 8 = tan-(m) to
P allign it with x-axis. Rotation matrix is given by
A A =

cos (-6) sin (-0)


- sin (-0) cos (-8)
Fig.3.16.
P )
(2) Reflection about x-axis is obtained. Let [A,] represent the reflection matrix. Then
Fig. 3.14. Reflection about r-axis.

A=0 -1

0
Reflection matrix is given by
(3) Now the line is rotated by angle 8 in counter-clockwise direction so that original
position of line is restored.
y), then X Y 1] =
X Y 1] x
[R
Hence if after reflection, coordinates are (x,
Reflection About y-axis (Refer Fig. 3.15) cos Sin6

A = |-sin cose
0 0

,) The resultant reflection matrix [R} is obtained by concatenating [A,), [A,], lA,l as

[R) = A , x [A,l x [A3

is a mx +c (i.e. equation
Liney
The Reflection Matrix when Axis of Reflection
=

of line not passing through origin)


are involved:
Thefollowing steps
Translate the line so that it passes through origin.
(2) Rotate so as to allign it with one of the axis.
Fig.3.15. Reflection about y-axis.
Fundamentals of CAD/CAM Computer Graphics

114 115
is obtained. cos (-71.56)
about this axis sin (-71.56) 0
(3) Next, reflection inclination.

4) The line is
rotated back to
its original
position.
R -sin (-71.56) cos(-71.56) 0
translated back to its original
(6) The line is concatenating the above five transformati.. 0
is obtained by
The resultant matrix d reflection about x-axis. Let RJ
matrices. represent the reflection matrix,
then
matrix when the axis of reflection is line y = 2x,
10 0
EXAMPLE 3.6. Find the reflection
involved
Solution: Following steps are
clockwio
2r has to be rotated by
an angle 0 tan (2) 63.43°, in
=
=

1
(1) The line y =

be the rotation matrix, when


direction to align it with x-axis.
Let [Rl N Now rotate the x-axis by angle o =
tani (3) in
cos (-63.43) sin (-63.43°) 0 represent the rotation matrix, then anticlockwise direction. Let IR,J
-sin (-63.43) cos (-63.43) 0
IR cos (71.56 sin (71.56) 01
0 R = - s i n (71.56*)
cos (71.56) 0
(2) Let reflection matrix about x-axis by (R,, then 1
(5) Translate the line by 2 units in positive y-direction in order to
restore the position
of line y 3x + 2. Let I7z represents the translation
R=0-1 0 =
matrix, then
0 1 1 0 01
(3) The line is rotated back by an angle = tan-l (2) in counter-clockwise direction s0 ITJ = 0 1 o
that the original position of the line y = 2x is restored 0 2 1
cos (63.43) sin (63.43°) 0 The complete transformation matrix lR) can be obtained by concatenating IT,], R,],
IR= -sin (-63.43) cos (63.43) 0 R, [RI and [T,) as
0 0
IR = 1T,] x IR,] x IRJl IRx {T5
These transformations are shown in Fig. 3.17.
The final resultant matrix [R] is obtained by concatenating i.e.

The reflection of any point say P2, 3) can now be obtained. Let (xr,
of point of reflection, then
y) be the coordinates

1 12 3 1 x
IR
EXAMPLE 3.7. Find the reflection matrix when axis
of reflection is y 3x + 2. =

Solution: The following


steps are involved Original position 1. Translation 2. Rotatio
(1) Translating the line y 3x +2 ofline
by 2 units in negative y-direction, so that it passes
=

through origin. Let [7,| be the translation matrix, then


1
IT = 0
0
-2 1
(2) Rotate the line by
it x-axis. Let
an angle 0 =
tan-l (8) =
71.56° in clockwise direction to
[R,) represent the rotation matrix. make 3. Reflection 5. Translation
4. Rotation

Fig.3.17.
Fundamentals of CAD/CAM
Computer Graphics
116

Similarly
117
3.9.5 Shear of an object or an image.
distortat11on
transformation produces
A shearing 3.18.
There a r e two types
of shear. Refer Fig. x'2 2 =18 10 11
10 0
(1) x-direction shear.
x
0 1
o
(2) y-direction shear. will. 2 3 1
will change while the y-coordinate vill remain
1] = [10
13
the x - c o o r d i n a t e
In x-direction shear, factor in
x - d i r e c t i o n then the
basic equations are x2 2) = (10, 13)
is the shearing
s a m e . IfSh, * +
Sh, x y
1 9.9. A line having end
EXAM in direction. Find (2, 2) and (5, 5) is
the x-coordinate will remain 5 units
y-dirn the
transformation matrixsealed by 2 units
and the final
in a
x-direction and
the y-coordinate will change whilebasic equations are #ion : The transtormation matrix is given coordinates of the line.
In y-direction shear, then the by
factor in y-direction
s a m e . IfSh, is the shearing
S O 2 0 01
1 y +x x
Sh,
IS =

0 s, 0=0 5 0
0
1 lo o
1
Tot the new coordinates be
(1 y1) and
(r'2 2) corresponding to (2, 2) and (5, 5) then:
''1 1 =l y 1] x [S]

2 0 0
1 1 =12 2 1x 0 5
0 1
y-Direction shear
x-Direction shear
' 1 1 =[4 10 1
Fig. 3.18. x1 y =(4, 10)
is translated by 2 units in
end points (3, 5) and (8, 10) Similarly
EXAMPLE 3.8. A line having translation matrix and position of
end
2 0 00
Find the
z-direction and 3 units in y-direction.
points after translation operation. y'2 1 =
[5 5 1]x |0 5 0
matrix in given by 00 1|
Solution: The translation

0
0 1 [10 25 1
0 1
=

1 0 2
I7=0 1 0 = 0 1 0
25)
Hence lx2 2)= (10, anticlockwise
45° in
2 3 1 5) (10, 10) is
rotated by
line having end points (4, the final c o o r d i n a t e s of the line
be EXAMPLE 3.10. A and
and (x,', y^) and (x2, Y2) matrix
Find the transformation
the end points of the line initially airection.
If (x,Y1) & (r2, Y2) are
then transformation matrix is given by
translation Solution The sin45 0
the n e w coordinates after :
cos 45°
1) [7] sin 0
,y, 1 =
k, y, x cos6
0 = - s i n 45° cos
45 0
0 0 R = -sin 0 cos 0 0
0 0
x s1 1] =[3 5 1) x

931 .707
.707
.707
707 0
1]
x, , =
[5 8 1]
0
yl= (5, 8)

thlen

harshtin

1y, t2
ore
r t

You might also like