Geometric transformations

Homogeneous 2-D transformation matrices, concatenation order, rotation and scaling about an arbitrary point, and reflections, with worked numericals.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Every time a CAD user moves, copies, mirrors or patterns a feature, or a CAM system shifts a toolpath from the part's datum to the machine's coordinate system, the software multiplies coordinates by a transformation matrix. The same mathematics is behind robot kinematics and coordinate measuring machines. Getting the order of the matrices or the sign of an angle wrong moves the part to the wrong place — exactly the kind of error GATE questions test.

Key ideas

Rigid-body and non-rigid transformations. Translation and rotation are rigid: they preserve lengths and angles. Reflection (mirror) also preserves lengths but reverses handedness — a left-hand part becomes a right-hand part. Scaling changes size; uniform scaling keeps shape, non-uniform scaling distorts it.

Why homogeneous coordinates. In ordinary 2-D coordinates, rotation and scaling are matrix products but translation is an addition, so a chain of operations cannot be collapsed into one matrix. Writing a point as [x, y, 1]ᵀ (a 3 × 1 column) makes translation a matrix product too. Then any sequence of moves becomes one 3 × 3 matrix (4 × 4 in 3-D), computed once and applied to thousands of points.

Convention used here. Points are column vectors and the matrix pre-multiplies: P′ = M·P. Positive angles are counter-clockwise when viewed with the axis pointing at you (right-hand rule). Some textbooks use row vectors (P′ = P·M), in which case every matrix is transposed and the multiplication order reverses — always check which convention a question uses.

Concatenation and order. If the operations are M₁ first, then M₂, then M₃, the composite is M = M₃·M₂·M₁ — the first operation sits next to the point (rightmost). Matrix multiplication is not commutative: rotating then translating is not the same as translating then rotating.

Rotation or scaling about an arbitrary point (xₚ, yₚ). The basic matrices act about the origin. To act about another point: translate that point to the origin, rotate (or scale), translate back: M = T(xₚ, yₚ) · R(θ) · T(−xₚ, −yₚ).

Reflection. About the x-axis: y → −y. About the y-axis: x → −x. About the line y = x: (x, y) → (y, x). About the origin: (x, y) → (−x, −y), identical to a 180° rotation. Two reflections about the same line restore the original; two reflections about intersecting lines give a rotation of twice the angle between them.

3-D. Points become [x, y, z, 1]ᵀ and matrices 4 × 4. Rotation about the z-axis uses the same 2-D block in x and y with z unchanged; rotations about x and y follow by cycling the axes (x → y → z → x). In CNC and robotics these 4 × 4 matrices relate the workpiece, fixture, machine and tool frames.

Formulas

T(tx, ty) = [[1, 0, tx], [0, 1, ty], [0, 0, 1]]

  • Translation by tx, ty (mm).

R(θ) = [[cos θ, −sin θ, 0], [sin θ, cos θ, 0], [0, 0, 1]]

  • Rotation by θ (degrees or radians) counter-clockwise about the origin.

S(sx, sy) = [[sx, 0, 0], [0, sy, 0], [0, 0, 1]]

  • Scaling about the origin by factors sx, sy (dimensionless). sx = sy for uniform scaling.

P′ = M · P , P = [x, y, 1]ᵀ

  • Applying a transformation to a point (column-vector convention).

M = M_n · … · M₂ · M₁

  • Composite of M₁ applied first, M_n last.

M = T(xₚ, yₚ) · R(θ) · T(−xₚ, −yₚ)

  • Rotation about the pivot (xₚ, yₚ). Expanded: x′ = xₚ + (x − xₚ)cos θ − (y − yₚ)sin θ, y′ = yₚ + (x − xₚ)sin θ + (y − yₚ)cos θ.

Worked examples

Example 1 (standard). Point P(2, 3) is translated by (3, 4), then rotated 90° counter-clockwise about the origin, then scaled uniformly by 2 about the origin. Find the final point.

  1. Translate: (2 + 3, 3 + 4) = (5, 7).
  2. Rotate 90°: cos 90° = 0, sin 90° = 1, so x′ = −y, y′ = x: (5, 7) → (−7, 5).
  3. Scale by 2: (−7, 5) → (−14, 10).
  4. Check of order: if the same point is rotated first and then translated, it goes (2, 3) → (−3, 2) → (0, 6) — a different place, confirming that order matters.

Example 2 (GATE level). Triangle A(2, 2), B(6, 2), C(4, 5) is rotated 90° counter-clockwise about the point (4, 3). Find the composite matrix and the new vertices.

  1. M = T(4, 3) · R(90°) · T(−4, −3).
  2. Using the expanded form with cos θ = 0, sin θ = 1: x′ = 4 − (y − 3) = 7 − y, y′ = 3 + (x − 4) = x − 1. So M = [[0, −1, 7], [1, 0, −1], [0, 0, 1]].
  3. A(2, 2): x′ = 7 − 2 = 5, y′ = 2 − 1 = 1 → A′(5, 1).
  4. B(6, 2): x′ = 5, y′ = 5 → B′(5, 5).
  5. C(4, 5): x′ = 2, y′ = 3 → C′(2, 3).
  6. A′(5, 1), B′(5, 5), C′(2, 3). Check: AB was horizontal with length 4; A′B′ is vertical with length 4, as a 90° rotation requires.

Common mistakes

  • Multiplying matrices in the order the operations are listed. With column vectors the first operation goes on the right.
  • Rotating about the origin when the question says "about a point" — the translate–rotate–translate-back sandwich is needed.
  • Using a clockwise matrix for a positive (counter-clockwise) angle, or the opposite sign of sin θ.
  • Mixing row-vector and column-vector conventions halfway through a problem.
  • Forgetting that scaling about the origin also moves the object unless it is centred there.
  • Using degrees in a calculator set to radians.

For GATE PI

Expect NAT questions on the new coordinates of a point or vertex after a sequence of transformations, rotation or scaling about an arbitrary point, and composite matrix entries; and MCQs on homogeneous coordinates, non-commutativity and properties of reflections. Practise writing the composite matrix in the right order, then check one point by hand.

Quick check

  1. Why are homogeneous coordinates used?
  2. Write the composite for "scale by 2, then translate by (1, 0)" with column vectors.
  3. Rotate (5, 0) by 30° counter-clockwise about the origin.
  4. Scale point (4, 3) by 3 about the fixed point (2, 1).
  5. What single transformation equals reflection about the x-axis followed by reflection about the y-axis?

Answers: 1. So that translation, like rotation and scaling, becomes a matrix product and a chain collapses into one matrix. 2. M = T(1, 0)·S(2, 2). 3. (4.330, 2.5). 4. (8, 7). 5. A 180° rotation about the origin.

Try answering each one aloud before you open it.

  1. 1.What is a geometric transformation in the context of computer integrated manufacturing?Concept

    A geometric transformation in computer integrated manufacturing refers to the mathematical operations that change the position, orientation, or size of a geometric object. These transformations include translation, rotation, scaling, and reflection, and are used to manipulate the geometry of parts in a manufacturing process.

  2. 2.Explain the difference between translation and rotation transformations.Concept

    Translation is a geometric transformation that moves an object from one location to another without changing its orientation or size. It involves adding a constant value to the coordinates of the object. Rotation, on the other hand, involves turning an object around a fixed point, known as the pivot, by a certain angle. This changes the orientation of the object but not its size or shape.

  3. 3.How is scaling transformation applied in manufacturing processes?Concept

    Scaling multiplies coordinates by a factor about a fixed point: S(sx, sy) about the origin, or translate–scale–translate back about another point. Uniform scaling (sx = sy) keeps the shape and is used for family-of-parts variants and for adding shrinkage allowance to pattern and mould cavities. Non-uniform scaling distorts the shape and is used when shrinkage differs by direction, for example in injection moulding of fibre-filled plastics or in 3-D printing compensation.

  4. 4.Why is rotation transformation important in CNC machining?Application

    Rotation transformation is crucial in CNC machining because it allows for the precise orientation of parts and tools. By rotating the workpiece or the tool, complex geometries can be machined with high accuracy. This is essential for creating parts with specific angular features or for aligning the tool path with the desired cutting direction.

  5. 5.What happens if a reflection transformation is applied twice to an object?Application

    Reflecting twice about the same line (or plane) gives the identity, so the object returns to its original position and handedness. Reflecting about two different lines that intersect at angle α gives a rotation by 2α about their intersection point; about two parallel lines it gives a translation of twice their spacing. This is why a mirror-of-a-mirror in CAD restores the original handedness.

  6. 6.How does the order of transformations affect the final result in geometric transformations?Application

    The order of transformations significantly affects the final result because geometric transformations are not commutative. For example, rotating an object and then translating it will yield a different result than translating it first and then rotating. Therefore, the sequence in which transformations are applied must be carefully considered to achieve the desired outcome.

  7. 7.Calculate the new coordinates of a point (3, 4) after a translation by (2, -1) and a rotation of 90 degrees counterclockwise around the origin.Numerical

    First, apply the translation: (3 + 2, 4 - 1) = (5, 3). Then, apply the rotation: For a 90-degree counterclockwise rotation, the new coordinates (x', y') are given by (-y, x). So, the new coordinates are (-3, 5).

  8. 8.A rectangle with vertices at (0, 0), (4, 0), (4, 3), and (0, 3) is scaled by a factor of 2 in the x-direction and 0.5 in the y-direction. What are the new coordinates of the vertices?Numerical

    Apply the scaling transformation to each vertex: (0, 0) becomes (02, 00.5) = (0, 0), (4, 0) becomes (42, 00.5) = (8, 0), (4, 3) becomes (42, 30.5) = (8, 1.5), and (0, 3) becomes (02, 30.5) = (0, 1.5). The new coordinates are (0, 0), (8, 0), (8, 1.5), and (0, 1.5).

  9. 9.Explain how homogeneous coordinates are used in geometric transformations.Concept

    Homogeneous coordinates are used to simplify the representation and computation of geometric transformations, especially when combining multiple transformations. By adding an extra dimension, transformations such as translation, which are not linear in Cartesian coordinates, can be represented as matrix multiplications. This allows for the combination of translation, rotation, and scaling into a single transformation matrix, facilitating efficient computation.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?