Matrix transformations
A 2×2 matrix moves every point of the plane, and its two columns say where the arrows î and ĵ end up. Everything else follows from those two arrows: the grid warps with them, and the unit square becomes the shaded shape. Drag the numbers in the matrix or the tips of the arrows, or pick a preset.
Things to try
- Flatten the square. Make the determinant 0, for example by dragging ĵ onto the line through î. The whole plane collapses onto that line.
- Flip it. Drag î past ĵ, and the determinant turns negative. The square comes out mirrored, so the shading changes color.
- Read the area. The area of the shaded shape is the size of the determinant, and every square of the grid is scaled by the same amount.
- Rotate. With
a = dandb = -c, the matrix rotates and scales without distorting anything. The squares of the warped grid stay square.
How it's built
- Four variables, one formula. Each matrix entry is a
<t-var>, and the matrix is a<t-math>with a\tangle{}in each cell. The colors come from the variables, so the first column is blue and the second orange, everywhere they appear. A<t-let>computesdetonce, for the formula and for the script, which turns the shading red when it's negative. - One effect draws it all. The effect reads
a,b,c,danddet, and redraws the warped grid, the shape and the arrows whenever one changes. The paper grid never changes, so it's drawn once, before the effect. See Updating a chart. - The arrows set variables. Dragging a tip converts the pointer to plane coordinates and
calls
scope.setValues. Then the formula, the determinant and the drawing all update. - Presets are animations. A button sets the four variables on every animation frame, easing from the current matrix to the preset's. Nothing else knows it's an animation: it's just values changing.
Open the source panels above for the full markup, script and styles.