Theory of Computation & Computer Graphics — Two-Dimensional Transformation, NEC licence examination syllabus (Nepal Engineering Council).
2D Composite Transformation: chaining multiple moves into one matrix
The topic that ties everything above together — and the single most commonly asked numerical in this chapter.
Real transformations are rarely just "rotate" or just "scale" alone — usually you need several combined. Instead of applying each one separately (slow, error-prone), you MULTIPLY the individual matrices together first, then apply the single combined matrix once.
Worked example — rotate about an ARBITRARY point (not origin):
To rotate around point P(a,b) instead of the origin:
Step 1: Translate by (−a, −b) — move P to the origin
Step 2: Rotate by angle θ — now rotation is about origin
Step 3: Translate by (+a, +b) — move P back to its original spot
Combined matrix = T(a,b) · R(θ) · T(−a,−b)
(matrices multiply RIGHT TO LEFT — the first operation applied
is the rightmost matrix in the multiplication)
This exact "translate to origin → do the operation → translate back" pattern is the master key for ANY transformation about a point other than the origin — rotation, scaling, reflection about an off-origin point, all use precisely this 3-step recipe.
💡 The guaranteed numerical: "Rotate triangle ABC by θ about point P(a,b)" or "Scale by factors (sx,sy) about a fixed point P" — practice this exact 3-matrix composition until it's automatic, plugging in real coordinate values.
The numerical, with real numbers
Rotate the point (5, 3) by 90° about P(2, 1). Working it step by step first:
Step 1 — translate so P goes to the origin: subtract (2,1)
(5, 3) → (5−2, 3−1) = (3, 2)
Step 2 — rotate by 90° about the origin
cos 90° = 0, sin 90° = 1
x' = 3(0) − 2(1) = −2
y' = 3(1) + 2(0) = 3
→ (−2, 3)
Step 3 — translate back: add (2,1)
(−2+2, 3+1) = (0, 4)
Answer: (5, 3) rotates to (0, 4).
Now the same thing as one combined matrix, which is what the question usually asks for:
That check is worth doing in an exam. If the combined matrix and the three-step working disagree, the multiplication order is wrong — and the most common cause is composing left to right instead of right to left.
Why right to left
The reason is not a convention to memorise but a consequence of how the point is written. With a column vector, the point sits on the right:
P' = T · R · T⁻¹ · P
↑
this one touches P first
The matrix nearest the point acts first, so reading right to left gives the order operations actually happen. Written with row vectors instead, the point would sit on the left and the order would reverse — which is why some textbooks show the opposite convention and both are correct.
💡 A quick way to check any composite answer: the fixed point must map to itself. Substitute P(2,1) into M — x' = 0(2) − 1(1) + 3 = 2 and y' = 1(2) + 0(1) − 1 = 1, giving (2,1) back. If the fixed point moves, the composition is wrong.
The same recipe, three uses
🔁 Translate, act, translate back
Rotation about PT(P) · R(θ) · T(−P)
Scaling about PT(P) · S(sx,sy) · T(−P)
Reflection about a line not through the originT · R · S(1,−1) · R⁻¹ · T⁻¹ — translate and rotate the line onto an axis, reflect, then undo both
💡 The pattern generalises: any transformation about an awkward place becomes a simple one wrapped in "move it somewhere convenient" and "put it back". The same idea appears in 3D, and in rotation about an arbitrary axis, where the wrapper is longer but the structure is identical.
Syllabus points
Combining transformations
Rotation/scaling about an arbitrary point (numerical)
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.