Composition & Inverses

Matrix multiplication means doing transformations one after another. Inverses undo what a matrix does.

Composition = Multiplication

When you apply transformation A and then transformation B, the combined effect is a single transformation. This combined transformation is represented by the matrix product BA (note: B times A, not A times B).

If a transformation can be "undone," its inverse exists. But not all transformations can be reversed—some destroy information by collapsing space.

Demo 1: Composition in Action

Watch as we apply rotation A, then shear B. The final result is exactly what the product matrix BA produces in a single step.

Key insight: Applying A then B is the same as applying the single matrix BA (note the order!). Matrix multiplication BA means "do A first, then B".

Demo 2: Order Matters (AB ≠ BA)

Matrix multiplication is not commutative. Rotating then scaling gives a different result than scaling then rotating.

A then B (Rotate → Scale)
First rotate 45°, then scale
B then A (Scale → Rotate)
First scale, then rotate 45°

AB ≠ BA (order matters!)

Rotating then scaling gives a different result than scaling then rotating.

A (Rotate 45°):
[0.71, -0.71]
[0.71, 0.71]
B (Scale 2×, 0.5×):
[2.00, 0.00]
[0.00, 0.50]

Demo 3: The Inverse Undoes

The inverse matrix A⁻¹ reverses what A does. Apply A, then A⁻¹, and you're back where you started. The identity matrix I (which does nothing) satisfies A·A⁻¹ = I.

Matrix A:
[1.50, 0.50]
[0.30, 1.20]
Matrix A⁻¹:
[0.73, -0.30]
[-0.18, 0.91]

The inverse matrix A⁻¹ undoes what A does. Applying A then A⁻¹ (or vice versa) returns to the identity—no transformation at all.

Demo 4: When Inverses Don't Exist

A singular matrix (determinant = 0) collapses space to a lower dimension. Once collapsed, you can't reconstruct where points came from—no inverse exists.

Determinant
1.000
Inverse exists?
Yes

As the matrix approaches singular (det → 0), space collapses to a lower dimension. Information is lost—you can't tell where points came from, so there's no inverse.

Key Takeaways

  • Composition is multiplication: A then B = BA (right to left!)
  • Order matters: AB ≠ BA in general
  • Inverse undoes: A⁻¹ reverses the effect of A
  • Singular = no inverse: det = 0 means information is lost
  • Identity does nothing: AI = IA = A

Next: Let's explore determinants—the number that tells us how much space stretches or compresses.