Skip to content
Saha Hesap

2D Transformation Matrix: Rotate and Translate Coordinates

Translate, rotate, scale and reflect a list of points. Chains the steps in order and gives the 3×3 transformation matrix, the new coordinates and a before and after sketch.

What is a coordinate transformation?

Moving, rotating, resizing or mirroring a shape by changing its corner coordinates is a coordinate transformation. Each one is a simple rule that gives new coordinates from old ones. Several transformations applied one after another can be combined into a single matrix.

Translation and rotation

A translation adds the same amount to every point: x′ = x + Δx, y′ = y + Δy.

A rotation by θ about the origin gives x′ = x·cos θ − y·sin θ and y′ = x·sin θ + y·cos θ. A positive angle is counterclockwise. A 90 degree turn sends (x, y) to (−y, x).

To rotate about another centre, write the point relative to the centre, rotate it and add the centre back.

Example

Rotate the point (4, 2) by 30 degrees about the origin and then translate it by (10, 5). After the rotation x = 4 × 0.866 − 2 × 0.5 = 2.464 and y = 4 × 0.5 + 2 × 0.866 = 3.732. The translation gives the new point (12.464, 8.732).

The transformation matrix

A translation cannot be written as a 2×2 matrix on its own. So a third component (1) is added to the point and a 3×3 matrix is used. Its upper left 2×2 block carries rotation, scaling and reflection, and its last column carries the translation. Chained transformations multiply their matrices, with the first step on the far right of the product.

Why does the order matter?

Rotating then translating differs from translating then rotating. The point (1, 0) rotated by 90 degrees and then moved by (1, 0) ends at (1, 1), while moving first and rotating second ends at (0, 2).

Where is it used?

Converting design coordinates to a local grid on site, moving the hole coordinates of a part to a rotated position, producing the other half of a symmetric part by reflection, shifting a work offset on a machine tool and transforming shapes in computer graphics all use this calculation.

Limits

The calculator works in the plane and does not convert units. Map datum and projection conversions are outside its scope.

Related calculators

Found a mistake or something missing?

If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.

Send an email