Skip to content
Tactiverge

School/○ Innovator/Week 13

Order matters: composing and undoing matrices

Shear then rotate, or rotate then shear? A robot's hand ends up in a different place. Why should order matter for multiplication?

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

A robot arm is a chain of motions: turn the shoulder, then the elbow, then the wrist. Chaining motions is matrix multiplication, and because the order of physical motions matters, the order of matrices matters too. Knowing how to undo a matrix (its inverse) is how a robot converts world measurements back into its own frames.

  • ◇ Multiply two 2×2 matrices and read the product as 'do the right one first'.
  • ◇ Show by example that A·B ≠ B·A in general.
  • ◇ Undo a rotation with its inverse, R(θ)⁻¹ = R(−θ) = R(θ)ᵀ.

2.Discover

Choose Shear. Set 'Combine with a 90° turn' to R·M, then to M·R. Write down P′ both times. Repeat with Rotate at 30° instead of Shear: do R·M and M·R still differ? Explain the difference.

Loading the interactive…

Can't use the interactive? Read a description instead

With the Shear preset and the 'R·M' option, the point (1.5, 1) lands at (−1, 2.5); with 'M·R' it lands at (0.5, 1.5), so the two orders differ. With the Rotate preset both orders give the same result, because rotations in the plane commute.

3.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

[1 2; 3 4]·[5 6; 7 8]: what is the entry in row 2, column 1?

4.Predict

R is a 90° rotation and S is a shear. For the point (1.5, 1), will R·S·p and S·R·p be the same?

Guess first. Being wrong here is how the surprise works.

5.Understand

Multiplying matrices

(A·B) entry in row i, column j = row i of A · column j of B. For 2×2: [a b; c d]·[e f; g h] = [ae + bg af + bh; ce + dg cf + dh]. The product A·B means 'first B, then A', because (A·B)·v = A·(B·v): the matrix nearest the vector acts first.

Order matters

In general A·B ≠ B·A. Physical intuition: put a book flat, rotate it 90° about a vertical axis, then flip it about a front-to-back axis; now do it the other way round. Different result. Planar rotations happen to commute, R(α)R(β) = R(α + β) = R(β)R(α), but mix in a shear, a scale or 3D rotations and order becomes everything.

Undoing: the inverse

The inverse M⁻¹ satisfies M⁻¹·M = I (the identity, [1 0; 0 1]). For 2×2: M⁻¹ = (1/det)·[d −b; −c a], which exists only when det ≠ 0. For rotations it is beautifully cheap: R(θ)⁻¹ = R(−θ) = R(θ)ᵀ (swap rows and columns). Undoing a turn is turning back.

Explain it another way

Putting on socks then shoes is not the same as shoes then socks. Undoing reverses the order too: shoes off first, then socks. Matrices work exactly like getting dressed.

Worked example 1

Find the inverse of M = [2 1; 5 3] and check it.

det = 6 − 5 = 1. M⁻¹ = [3 −1; −5 2]. Check row 1 · col 1: 3×2 + (−1)×5 = 1; row 1 · col 2: 3×1 + (−1)×3 = 0. ✓

Common mix-ups

  • A·B is 'A first, then B'.
    ✓ Acting on a vector, A·B·v applies B first. Read products right to left.
  • The inverse of a product reverses each matrix but keeps the order.
    ✓ (AB)⁻¹ = B⁻¹A⁻¹: undo the last thing first.

6.Watch

→ Watch for reading a product right to left: the matrix nearest the vector acts first.

Explains why multiplying matrices means doing one transformation after another, and why the order matters.

10 min 3 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2 · a fresh version every time

A = [−2 2; −2 −2] and B = [2 3; −3 3]. What is the entry in row 1, column 1 of the product A·B?

Practice 3

In A·B·v, which transformation is applied to v first?

Practice 4

What is the inverse of R(40°)?

Practice 5 · a fresh version every time

Rotate the point (4, −1) by 30° about the origin (positive = anticlockwise). What is the new y coordinate? (3 decimal places)

8.Apply it

With the diagram's Custom matrix, find a matrix M (not a rotation or the identity) that does commute with the 90° turn R: R·M·P = M·R·P. Describe what kind of transformation it is.

9.Reflect

10.Go further

Concepts: Matrices and linear transformations