The spreadsheet that transforms
A photo filter takes every pixel's coordinates and shifts, rotates, or stretches them. That whole operation is stored as a small grid of numbers — a matrix — and multiplying applies the same transformation to every point at once.
Rows × columns
A matrix is a rectangular grid of numbers with shape (rows × columns). To multiply A (m×n) by B (p×q) the inner dimensions must match (n = p); the result is m×q. Each entry is the dot product of a row of A with a column of B.
[1 2; 3 4] · [5; 6] = [1·5 + 2·6; 3·5 + 4·6] = [17; 39]
Lab · Check the shapes
- Write down the shape of each matrix as (rows × columns).
- Confirm the inner numbers match before multiplying.
- The answer's shape is the two outer numbers.
What you should see: A (2×3) times B (3×4) is valid because the inner 3s match, and the product is 2×4.