# 2D Translation in Computer Graphics

Computer Graphics 2D Translation

We can move any object from one to another place without changing the shape of the object.

For Example-

Translation of a Point: If we want to translate a point from P (x0, y0) to Q (x1, y1), then we have to add Translation coordinates (Tx, Ty) with original coordinates.

We can also represent the translation in matrix form-

We can apply Translation on following objects-

• Line
• Rectangle
• Polygon
• Square

Homogeneous Coordinate Representation:

The above Translation is also shown in the form of 3 x 3 matrix-

Here, Translation coordinates (Tx, Ty) are also called “Translation or Shift Vector.

Example– Given a Point with coordinates (2, 4). Apply the translation with distance 4 towards x-axis and 2 towards the y-axis. Find the new coordinates without changing the radius?

Solution: P = (x0, y0) = (2,4)

Shift Vector = (Tx, Ty) = (4, 2)

Let us assume the new coordinates of P = (x1, y1)

Now we are going to add translation vector and given coordinates, then

x1 = x0 + Tx = (2 + 4) = 6

y1 = y0 + Ty = (4 + 2) = 6

Thus, the new coordinates = (6,6)