A transformation maps points to points.
Every geometric operation — move, spin, stretch — is a function that takes a point and returns a new point. The remarkable trick: if we use 3x3 matrices (homogeneous coordinates), then translation, rotation, and scale all become matrix multiplications. That means we can compose any sequence of operations into a single matrix.
Order matters. Rotate-then-translate is not the same as translate-then-rotate. The triangle ends up in a different place. This is the first real gotcha of computer graphics — and the source of more bugs than any single syntax error.
Stack operations and watch the triangle move.
Below is a triangle at the origin. Use the palette on the right to stack operations. The faint triangle is the original; the bright one is the result. The composed 3x3 matrix updates live.
Try: stack Rotate(30deg) then Translate(1, 0). Now clear, and do Translate(1, 0) then Rotate(30deg). Compare the two outcomes.
No operations yet.
[0.00, 1.00, 0.00]
[0.00, 0.00, 1.00]
Which order moves the triangle further from the origin?
If you apply Rotate(90deg) first, then Translate(2, 0), vs Translate(2, 0) then Rotate(90deg) — which final position is further from (0, 0)?
Reveal answer
They end up at the same distance from the origin (2 units), but in different positions. Rotate-then-translate moves the triangle to (0, 2). Translate-then-rotate moves it to (2, 0) rotated 90 degrees = (0, 2) — wait, that is the same! The surprise: for this specific case they match. Try different angles to see them diverge.
Verify by building both stacks.
Clear the stack and try both orderings. With Rotate(30deg) + Translate(1, 0) vs Translate(1, 0) + Rotate(30deg), the final positions differ noticeably.
No operations yet.
[0.00, 1.00, 0.00]
[0.00, 0.00, 1.00]
Hit the target.
Challenge: Get the triangle from its starting position to the target (the dashed gold outline) using exactly three operations from the palette. Multiple solutions exist.
No operations yet.
[0.00, 1.00, 0.00]
[0.00, 0.00, 1.00]
Move the triangle to match the gold target. Any valid operation stack counts.
No operations yet.
[0.00, 1.00, 0.00]
[0.00, 0.00, 1.00]