Matrices as transformations — Mathematics, 14–17
A matrix is a rectangular arrangement of numbers that can act on data, points or shapes in a controlled way.
A machine for changing coordinates
Think of a matrix as a rule written in a grid. When it meets a column of coordinates, it produces new coordinates: a shape may stretch, turn, reflect or shear. The entries are not just a table; their positions tell the rule how to combine the input numbers.
Why organise numbers this way?
Transforming many coordinates one at a time is slow and easy to repeat incorrectly. A matrix packages all the multiplications and additions into one object, so the same operation can be applied to thousands of points or data values. Matrix multiplication then combines several transformations into a single calculation.
Stretching a point
Use the matrix [[2,0],[0,3]] on the point (4,5). Multiply the first row by the column: 2×4 + 0×5 = 8. Multiply the second row: 0×4 + 3×5 = 15. The point becomes (8,15): horizontal distances doubled and vertical distances tripled.
Order matters
A reasonable mistake is to multiply matrices as if every entry simply matched the entry beside it. Matrix multiplication is different: rows meet columns, and the inner dimensions must fit. Its order also matters; stretching and rotating a shape in opposite orders can give different final positions.
Images, games and data
Computer graphics use matrices to move, rotate and resize objects in games, animation and 3D design. Image filters also treat groups of pixel values as arrays, while data scientists use matrices to organise measurements from many examples. The same compact rule can therefore control a picture or process a large dataset.
Keep exploring
Other languages
Loading MyLeoNes™…