Presentation is loading. Please wait.

Presentation is loading. Please wait.

2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location.

Similar presentations


Presentation on theme: "2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location."— Presentation transcript:

1 2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location to another. We translate a two-dimensional point by adding translation distances, tx and ty to the original coordinate position (x, y) to move the point to a new position ( x ', y') x' = x + tx, y' = y + ty The translation distance pair (tx, ty) is called a translation vector or shift vector.

2 Translation is also represented by single matrix equations as P’ = P + T where P= X1 P’ = X1’ T = Tx X2 X2’ Ty To change the position of curves like Circle or Ellipse we translate the center coordinates and redraw figure at new location.

3 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 (Ɵ ) theta and the position (xr, yr) of the rotation point (or pivot point) about which the object is to be rotated. Positive values for the rotation angle define counterclockwise rotations about the pivot point and negative values rotate objects in the clockwise direction.

4 We first determine the transformation equation for rotation of point P when the pivot point is at origin. The original coordinates of point in polar coordinates are x = r cos ɸ, y = r sin ɸ Using standard trigonometric identities we can express the transformed coordinates in terms of angle and as X’ = r cos (ɸ + Ɵ) = r cosɸ cosƟ – r sinɸsinƟ Y’ = r sin (ɸ + Ɵ) = r cosɸ sinƟ + r sinɸcosƟ

5 Substituting the values from previous equations we have X’ = x cosƟ – ysinƟ Y’ = x sinƟ + ycosƟ We can also write the rotation eqautions in matrix form as P’ = R. P Where R= cosƟ – sinƟ sinƟ cosƟ

6 In case when coordinates are represented ad row vectors instead of column vectors translation can be represented as P[x’, y’] = P [x, y] + T[tx, ty] Rotation can be represented as P’ t = [R. P] t P’ t = P t. R t Where P t [x, y] and R t can be obtained by interchanging rows and columns.

7 Now we will consider the rotation of point P (x, y) about an arbitrary pivot point (xr, yr ) then we can obtain the point P’ (x’, y’) as X’ = x r + (x – x r ) cosƟ – (y – y r )sinƟ Y’ = y r + (x – x r ) sinƟ + (y – y r ) cosƟ

8 SCALING A scaling transformation alters 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 s x and s y to produce the transformed coordinates (x', y'): x’ = x. s x And y’ = y. s y Scaling factor s x scales objects in the x direction, while s y scales in the y direction.

9 Transformation equations can also be written in matrix form as P’ = S. P Where P’ = x’ P = x S = s x 0 y’ y’ 0 s y Assigning value less than 1 to scaling factors reduces the size of object, value greater the 1 increases the size of object

10 When scaling factors are assigned same values then uniform scaling is produced that maintains relative object proportions. Unequal values of scaling factors result in differential scaling. Scaling factors with values less than 1 moves object closer to the coordinate origin values greater than 1 moves object farther from origin.

11 We can control the location of the scaled object by choosing a position, called the fixed point that is to remain unchanged after the scaling transformation. Let the coordinates of fixed point be(x f, y f ) then we can obtain the transformation eq. as x’ = x f + (x - x f )s x and y’ = y f + (y - y f )s y we can rewrite these equations as x’ = x. s x + x f (1 – s x ) and y’ = y. s y + y f (1 – s y ) Where the additive terms x f (1 – s x ) and y f (1 – s y ) are constants for all points in the object.


Download ppt "2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location."

Similar presentations


Ads by Google