2D Translation

Translation is one of the most fundamental geometric transformations in computer graphics, used to reposition objects on a 2D plane without altering their shape, size, or orientation. It forms the building block for understanding more advanced transformations such as rotation and scaling about an arbitrary point.

What is Translation?

Translation is a transformation that moves every point of an object by a fixed distance in a given direction, on the 2D plane (the XY-plane). 

Every point of the object shifts by the same amount, so the object's internal structure distances between points, angles, shape, and size remains completely unchanged. Only the object's position changes.

In 2D, a translation is defined using two displacement values:

  • tx — displacement along the X-axis
  • ty — displacement along the Y-axis

Together, (tx, ty) is called the translation vector.


Mathematical Definition

If a point in the 2D plane is P(x, y), after translating it by (tx, ty), the new point P'(x', y') is given by:

x' = x + tx
y' = y + ty

In vector form:

P' = P + T

where T = (tx, ty) is the translation vector.


Why Homogeneous Coordinates?

Translation is an additive operation, whereas other transformations like rotation and scaling are multiplicative (they're expressed by multiplying coordinates with matrix entries). 

This mismatch creates a problem: using ordinary 2×2 matrices, translation cannot be expressed as a matrix multiplication only as vector addition. As a result, translation cannot be directly combined with rotation or scaling into a single matrix product.

To resolve this, computer graphics uses homogeneous coordinates: a 2D point (x, y) is represented as a 3D point (x, y, 1), with an extra coordinate (commonly called w) appended and set to 1 for points. 

This allows translation to also be represented as a matrix multiplication, using a 3×3 matrix:

| x' |   | 1  0  tx | | x |
| y' | = | 0  1  ty | | y |
| 1  |   | 0  0  1  | | 1 |

Expanding this matrix multiplication confirms it reproduces the original equations:

x' = (1)(x) + (0)(y) + (tx)(1) = x + tx
y' = (0)(x) + (1)(y) + (ty)(1) = y + ty

So the 2D translation matrix is:

T(tx, ty) = | 1  0  tx |
            | 0  1  ty |
            | 0  0  1  |

Geometric Interpretation

Translation slides an object across the plane without rotating, scaling, reflecting, or shearing it. Geometrically:

  • Lines remain parallel to their original direction.
  • Distances between any two points on the object remain unchanged.
  • Angles within the object remain unchanged.
  • The object's orientation (which way it's "facing") is preserved.

Because of these properties, translation is classified as a rigid-body transformation (also called an isometry) a transformation that preserves distances and angles.

Properties of 2D Translation

  1. Identity case: If tx = ty = 0, the translation matrix becomes the identity matrix, and the object stays exactly where it is.
  2. Inverse translation: The inverse of a translation T(tx, ty) is a translation in the opposite direction:

    T^-1(tx, ty) = T(-tx, -ty)

    To undo a translation, you simply move back by the same amount in the opposite direction.

  3. Composition (combining two translations): Applying two translations one after another is equivalent to a single translation by the sum of the vectors:

    T(tx1, ty1) · T(tx2, ty2) = T(tx1+tx2, ty1+ty2)
  4. Commutativity: Translations commute with each other applying them in either order produces the same final result:

    T(a) · T(b) = T(b) · T(a)
  5. Does not commute with rotation/scaling: When translation is combined with rotation or scaling, the order matters. Translating an object away from the origin and then rotating it produces a different result than rotating it in place and then translating it the former causes the object to "orbit" around the origin rather than simply spin in place.
  6. Determinant: The translation matrix has a determinant of 1, meaning it preserves area consistent with its identity as a rigid-body transformation.

Translation in Composite Transformations

In real 2D graphics applications (UI animation, vector graphics editors, games), translation is typically the final step in a transformation pipeline:

Model Matrix = T (Position) · R (Orientation) · S (Size)

Translation is applied last so that scaling and rotation happen relative to the object's own local origin (e.g., its center), and only afterward is the object moved to its intended position in the world/screen space. 

If translation were applied first, the subsequent rotation or scaling would act relative to the world origin instead, causing the object to swing or jump away from where you placed it.


Solved Numerical Problems

Problem 1

A point P(3, 5) is translated using the translation vector (4, -2). Find the new coordinates of the point.

Solution:

x' = x + tx = 3 + 4 = 7
y' = y + ty = 5 + (-2) = 3

New point P' = (7, 3)

Problem 2

Find the translation matrix for moving an object by 6 units along X and -4 units along Y. Then use it to translate the point (2, 3).

Solution:

Translation matrix:

T(6, -4) = | 1  0   6 |
           | 0  1  -4 |
           | 0  0   1 |

Applying to point (2, 3, 1):

x' = 1(2) + 0(3) + 6(1) = 8
y' = 0(2) + 1(3) - 4(1) = -1

New point P' = (8, -1)

Problem 3

A line segment has endpoints A(1, 1) and B(4, 1). The segment is translated by vector (2, 3). Find the new positions of A and B, and verify the length of the segment is unchanged.

Solution:

Original length:

AB = √[(4-1)² + (1-1)²] = √9 = 3

Translated points:

A' = (1+2, 1+3) = (3, 4)
B' = (4+2, 1+3) = (6, 4)

New length:

A'B' = √[(6-3)² + (4-4)²] = √9 = 3

The length is unchanged (3 units), confirming translation is a rigid-body transformation.

Problem 4

A point P(2, 4) is first translated by (3, 1) and then translated again by (-1, 2). Find the final position, and verify it matches a single combined translation.

Solution:

Step 1 — Apply T1(3, 1):

P1 = (2+3, 4+1) = (5, 5)

Step 2 — Apply T2(-1, 2):

P2 = (5-1, 5+2) = (4, 7)

Combined translation vector: (3+(-1), 1+2) = (2, 3)

Verification: P + combined vector = (2+2, 4+3) = (4, 7) ✓ Matches.

Problem 5

A triangle has vertices A(0, 0), B(4, 0), and C(0, 3). Translate the triangle by the vector (-2, 5). Find the new coordinates of A, B, and C, and verify that the area of the triangle remains unchanged after translation.

Solution:

Original area (using the standard triangle area formula for a right triangle with legs 4 and 3):

Area = ½ × base × height = ½ × 4 × 3 = 6

Translated vertices:

A' = (0-2, 0+5) = (-2, 5)
B' = (4-2, 0+5) = (2, 5)
C' = (0-2, 3+5) = (-2, 8)

New area (legs are still 4 units along X and 3 units along Y, just shifted):

Area' = ½ × 4 × 3 = 6

The area is unchanged (6 square units), confirming translation preserves size and shape.

Problem 6 (Practice — try it yourself)

A rectangle has corners at A(1, 1), B(5, 1), C(5, 3), and D(1, 3). Translate the rectangle by the vector (3, -2). Find the new coordinates of all four corners, and verify that the perimeter of the rectangle remains unchanged after translation.

(Hint: original perimeter = 2 × (length + width) = 2 × (4 + 2) = 12.)


Conclusion

2D translation may be the simplest of the geometric transformations, but it lays essential groundwork: it introduces the concept of homogeneous coordinates, which is the key idea that makes it possible to combine translation, rotation, and scaling into a single unified transformation pipeline. 

A solid understanding of 2D translation its matrix form, properties, and composition rules makes the transition to 2D rotation, 2D scaling, and eventually full 3D transformations much more intuitive.

Previous Post
Homogeneous Coordinates and Matrix Representation
Next Post
2D Rotation
0 people found this article helpful

Was this article helpful?