Matrices: machines that move points
The question. How do you describe, in numbers, a bone that has turned or a muscle that has changed shape?
A vector places one point, but a bone is made of countless points, and when the elbow bends they all move together by one rule. The same is true of a small piece of muscle as it shortens and thickens. A simulator stores each such rule as a small grid of numbers called a matrix, and then asks it questions. Where did this point go? Did this piece of tissue keep its volume? How is the move undone?
By the end you will be able to apply a matrix to a point, read what it does from its columns, combine two matrices in the right order, and tell from one number whether a move changes volume.
A rule that moves points
Picture a block of soft rubber with one corner pinned at the origin. Turn it, stretch it, or push its top sideways. Every point of the block goes to a new place. Suppose the move treats the whole block alike, so that straight lines stay straight and evenly spaced marks stay evenly spaced. Such a move is called linear, and three arrows describe it completely: the places where the points one metre along , one metre along and one metre along end up. Call them , and .
A point that started at was reached by going along the first axis, along the second and along the third. After the move the same recipe works with the moved arrows:
In words: go along where the first axis went, along where the second went, and along where the third went.
A matrix is the grid of nine numbers made by writing those three arrows side by side as columns:
The columns of a matrix are where the axes go. That one fact lets you read any matrix, and write down the matrix for any linear move. The description follows Margalit, Rabinoff and Williams 2025, section 4.1.
Three kinds of move appear throughout this book.
- A rotation turns the block without changing its shape. A turn by the angle about the axis sends the axis to and the axis to , and leaves the axis where it was. The turned axis is the long side, of length 1, of a right-angled triangle whose other sides are and ; the axis is the same arrow a quarter turn further on. For a quarter turn, , the columns are , and .
- A stretch makes the block longer or shorter along the axes. Its columns are , and , where each is the factor along one axis.
- A shear slides layers of the block over one another, as when you push the top of a deck of cards sideways. The columns , and slide each layer along by times its height.
The matrix that moves nothing has the axes themselves as its columns. It is the identity matrix, written .
Does the move change volume?
A later part of this book models muscle as a material that keeps its volume: where it shortens, it must thicken. To impose that, the simulator needs a number that says how much a move changes volume.
Take a unit cube: a cube with sides of 1 m, one corner at the origin and edges along the axes. Its volume is 1 m³. After the move its edges are , and , and it has become a slanted box. The volume of a slanted box is the area of its base multiplied by its height.
- The base is the parallelogram with sides and . From the last chapter, its area is the length of , and that cross product stands perpendicular to the base.
- The height is the part of that lies along that perpendicular, which the dot product with a unit vector gives: .
Multiplying base by height, the length cancels:
This number is the determinant of the matrix. In words: the determinant is the factor by which the move multiplies volume. The factor is the same for every shape, because any shape can be cut into small cubes and each is scaled alike (Margalit, Rabinoff and Williams 2025, section 5.3).
- A rotation and a shear both have determinant 1. Turning a thing, or pushing a deck of cards sideways, does not change its volume.
- A stretch has determinant . The factors 2, 1 and ½ multiply to 1: twice as long, half as deep, the same volume. This is the kind of change a muscle that keeps its volume can make.
- A determinant of 0 means the block has been squashed flat.
- A negative determinant means the block has been turned inside out, as a left glove is the mirror of a right one. The volume then changes by the size of the determinant, ignoring its sign. Living tissue cannot make such a move.
A worked example
Take the matrix with columns , and . It doubles the block’s length along and leans it over:
| Quantity | Calculation | Result |
|---|---|---|
| Where the corner goes | ||
| Determinant | 2 | |
| Volume of the unit cube after the move | 2 m³ |
Try it: a matrix moves a block
The five sliders are the entries of the matrix. The third column is kept on the axis so that the picture stays easy to read.
- Check the worked example. The determinant reads 2, the volume goes from 1 m³ to 2 m³, and the far corner goes to (3, 1, 1). Press Play to watch every point slide to its new place.
- See that columns are where the axes go. Set column 2 to (0, 1): the lean disappears and a plain stretch is left. Now set column 1 to (1, 0). This is the identity matrix, and the block sits exactly in its outline.
- Predict, then check. Make a quarter turn: column 1 to (0, 1) and column 2 to (−1, 0). Where does the corner (1, 1, 1) go? To , and the determinant is 1.
- Keep the volume. Set column 1 to (2, 0) and column 2 to (0, 1), then predict what the third column must be for the volume to stay at 1 m³. Its part must be 0.5: the block is twice as long and half as deep.
- Shear it. Slide the part of column 2 from −1 to 1. The block leans one way and then the other, and the determinant does not move.
- Flatten it. With column 1 at (2, 0), set column 2 to (1, 0). Both arrows now lie along , the determinant is 0, and the lab reports that the block is flat.
- Turn it inside out. Set column 1 to (−1, 0) and column 2 to (0, 1). The determinant is −1.
- Change the shape. Return to the worked example and choose the forearm-shaped block. Its volume goes from 0.09 m³ to 0.18 m³: the same factor of 2.
One move after another
Apply a move , then apply a move to the result. The two together are again a linear move, so they have a matrix of their own, called the product . Its columns are found by taking each column of , which is where sends an axis, and applying to it. Written out, the entry in row and column of is the dot product of row of with column of .
Mind the order: means first. The matrix nearest the point acts first, , so a product is read from right to left.
The order matters (Margalit, Rabinoff and Williams 2025, section 4.4). Let be the quarter turn about and the stretch by 2 along :
Follow the point , the far end of a forearm-shaped block lying along .
| Order | First move | Second move |
|---|---|---|
| Turn, then stretch: | ||
| Stretch, then turn: |
Turned first, the block stands upright and the stretch along only makes it fatter. Stretched first, it becomes twice as long and then stands upright. The two products are different matrices:
One thing does not depend on the order. Each move multiplies volume by its own determinant, so the pair multiplies it by both: . Here that is either way.
Try it: the order of two moves
- Check the worked example. With a turn of 90° and a stretch of 2, the far ends are at (0, 1, 0) m and (0, 2, 0) m, 1 m apart. Press Play to watch each block make its two moves in turn.
- Predict, then check. Set the turn to 0°. Now both orders are the same stretch, and both far ends are at (2, 0, 0) m.
- Predict, then check. Set the turn to 45°. Turning first gives . Stretching first gives .
- Remove the stretch. Set the stretch to 1. A stretch by 1 is the identity matrix, and the order no longer matters at any angle.
- Compare the determinants. They agree for every setting, even when the shapes do not.
Undoing a move
The inverse of a matrix , written , is the matrix that sends every point back where it came from: . A turn by is undone by a turn by , a stretch by 2 by a stretch by ½, and a shear by by a shear by . For the worked example,
and it does send the moved corner back: .
A matrix with determinant 0 has no inverse. Once a block is flat, many different points have landed on the same spot, and no rule can send one spot back to many places (Margalit, Rabinoff and Williams 2025, section 5.1, “Invertibility Property”).
Turns keep lengths
The transpose of a matrix, written , is the same grid with rows and columns swapped: its rows are the columns of .
The columns of a rotation are the three axes after turning. They are still 1 long and still perpendicular to one another, so and for two different columns. Two things follow.
The transpose of a rotation is its inverse. The entry in row and column of is row of , which is , dotted with . That is 1 when and 0 otherwise, which is the identity matrix: . Undoing a turn costs no more than swapping rows and columns.
A rotation never changes a length. The squared length of the moved point is
because every product of two different columns is 0 and every product of a column with itself is 1. A forearm that turns about the elbow stays the same length.
What this model leaves out
- Shifting the whole block. A matrix leaves the origin where it is. A bone also changes place, which adds a vector to the result. Bones as rigid bodies combines the two.
- Turning about any axis. The rotations here turn about only. Turning in three dimensions treats turns about any line.
- Moves that differ from place to place. A real muscle shortens more in one region than another, so one matrix describes only the neighbourhood of one point. The part on deformable tissue uses a matrix at every point.
Summary
- A matrix is a rule that moves points: . Its columns are where the axes go.
- Rotation, stretch and shear are the building blocks. Applying and then is the product , and the order matters.
- The determinant is the factor by which volume changes: 1 keeps volume, 0 flattens, a negative value turns the shape inside out.
- The inverse undoes a move and exists unless the determinant is 0. For a rotation it is the transpose, and a rotation never changes a length.
Next: bones and muscles move as time passes, so we need a way to say how fast a quantity is changing: rates of change.