3. Translation
• It is the straight line movement of an object
from one position to another is called
Translation. Here the object is positioned from
one coordinate location to another.
5. Translation
• Translation of point:
• To translate a point from coordinate position
(x, y) to another (x1 y1), we add algebraically
the translation distances Tx and Ty to original
coordinate.
• x1=x+Tx y1=y+Ty
• The translation pair (Tx,Ty) is called as shift
vector.
6. Translation
• Translation is a movement of objects without
deformation. Every position or point is
translated by the same amount. When the
straight line is translated, then it will be drawn
using endpoints.
• For translating polygon, each vertex of the
polygon is converted to a new position.
9. • X' = Dx + X Y' = Dy + Y or P' = T + P where P' =
(X', Y'), T = (Dx, Dy ), P = (X, Y) Here, P(X, Y) is
the original point. T(Dx, Dy) is the translation
factor, i.e. the amount by which the point will
be translated. P'(X’, Y’) is the coordinates of
point P after translation.
13. Translation
• The translation can be represented by a column
vector as
• The top number represents the right and left
movement. A positive number means moving to
the right and a negative number means moving
to the left.
• The bottom number represents up and down
movement. A positive number means moving up
and a negative number means moving down.
• '
20. • From the above figure, you can write that −
• X’ = X + tx
• Y’ = Y + ty
• The pair (tx, ty) is called the translation vector or
shift vector. The above equations can also be
represented using the column vectors.
• P=[X][Y]P=[X][Y]
• p' = [X′][Y′][X′][Y′]
• T = [tx][ty][tx][ty]
• We can write it as −
• P’ = P + T
25. Rotation
• Matrix for rotation is a clockwise direction.
• Matrix for rotation is an anticlockwise
direction.
26. Rotation
• n rotation, we rotate the object at particular
angle θ theta theta from its origin. From the
following figure, we can see that the point
PX,YX,Y is located at angle φ from the
horizontal X coordinate with distance r from
the origin.
• Let us suppose you want to rotate it at the
angle θ. After rotating it to a new location, you
will get a new point P’ X′,Y′X′,Y′.
27. Rotation
• Using standard trigonometric the original
coordinate of point PX,YX,Y can be
represented as −
• X=rcosϕ......(1)
• Y=rsinϕ......(2)
•
28. Rotation
• ame way we can represent the point P’ X′,Y′ as
−
• x′=rcos(ϕ+θ)=rcosϕcosθ−rsinϕsinθ.......(3)
• y′=rsin(ϕ+θ)=rcosϕsinθ+rsinϕcosθ.......
32. • onsider a point object O has to be rotated from
one angle to another in a 2D plane.
•
• Let-
• Initial coordinates of the object O = (Xold, Yold)
• Initial angle of the object O with respect to origin
= Φ
• Rotation angle = θ
• New coordinates of the object O after rotation =
(Xnew, Ynew)
33. • his rotation is achieved by using the following
rotation equations-
• Xnew = Xold x cosθ – Yold x sinθ
• Ynew = Xold x sinθ + Yold x cos
34.
35.
36. • Example: The point (x, y) is to be rotated
• The (xc yc) is a point about which
counterclockwise rotation is done