Anda di halaman 1dari 9
4.2 Two Dimensional Transformations Im this section, we describe the general procedures for applying translation, rotation, and! scaling parameters to reposition and resize the two dimensional objects. 4.2.1 Translation Translation is a process of changing the position of an object ina straight-line path from [>_> one coordinate location to another. We can translate a two dimensional point by adding translation istances, t and t,, to the original coordinate position (x, y) to move the point to anew position (x, y'), as shown in the Fig. 4.1 +h an +h =(42) The translation distance pair (ts, t) is called a translation vector or shift vector. It is possible to express the translation equations 4.1 and 42 as a single matrix equation by using column vectors to represent coordinate positions and the translation vector Fig. 44 This allows us to write the two dimensional translation equations in the matrix form PoaPat 3) Ex.4l Translate a polygon with coordinates A (2, 5), B (7, 10) and C (10, 2) by 3 units in x direction and 4 units in y direction. Sol. 05 (o) Fig. 42 Translation of polygon Als AsT le [ 4.2.2 Rotation A two dimensional rotation is applied to an object by repositioning it along a circular path in the xy plane. To generate a rotation, we specify a rotation angle and the position of the rotation point about which the object is to be rotated A point (4, 3) is rotated counterelocktoise by on angle of 45° Find the rotation matrix and the resultant point sol { cosb sin0] _[ cosds” sings") “ {sind cos | [-sin 45" cosas® | yo Wi a2 Yh fai yy? Pe [a3 . ys Wi = [2-2 4ff2+ 9x2] = [2 22] 4.2.3 Scaling Ascaling transformation changes the size of an object. This operation can be carried out for polygons by multiplying the coordinate values (x, y) of each vertex by scaling factors Sy and S, to produce the transformed coordinates (x’, y" x =x-S, and y’=y-Sy (4.10) Scaling factor S, scales object in the x direction and scaling factor \$, scales object in the y direction. The equations 4.10 can be written in the matrix form as given below @ 0) Fig. 44 S, 0 byl = byl os, = PS. y Sy] (11)