Cheatsheet: Stepping up to 3D
What changes from 2D (almost nothing)
Section titled “What changes from 2D (almost nothing)”| 2D | 3D |
|---|---|
2 basis vectors (i-hat, j-hat) | 3 basis vectors (i-hat, j-hat, k-hat) |
| 2x2 matrix, columns are 2-vectors | 3x3 matrix, columns are 3-vectors |
M·v = x·col1 + y·col2 | M·v = x·col1 + y·col2 + z·col3 |
| Unit square becomes a parallelogram | Unit cube becomes a parallelepiped |
Same definition of linear (origin fixed, grid lines straight/parallel/even), same basis-vector trick, same composition rule. Just one more dimension.
The standard basis
Section titled “The standard basis”i-hat = [1, 0, 0] j-hat = [0, 1, 0] k-hat = [0, 0, 1]Every 3D vector: [3, 4, 5] = 3·i-hat + 4·j-hat + 5·k-hat.
A 3x3 matrix
Section titled “A 3x3 matrix”[ a b c ] col 1 [a,d,g] = L(i-hat)[ d e f ] col 2 [b,e,h] = L(j-hat)[ g h i ] col 3 [c,f,i] = L(k-hat)Worked examples (applied to [3, 4, 5])
Section titled “Worked examples (applied to [3, 4, 5])”| Transformation | Matrix | Result |
|---|---|---|
| Rotate 90 deg about z | [[0,-1,0],[1,0,0],[0,0,1]] | [-4, 3, 5] (x,y rotate; z fixed) |
| Rotate 90 deg about y | [[0,0,1],[0,1,0],[-1,0,0]] | [5, 4, -3] (x,z rotate; y fixed) |
| Scale (2, 3, 0.5) | [[2,0,0],[0,3,0],[0,0,0.5]] | [6, 12, 2.5] (each axis by its own factor) |
In 3D, “rotation” requires naming the axis: rotation about z, y, x are three different transformations.
Sketching the unit cube
Section titled “Sketching the unit cube”- Read the three columns: where
i-hat,j-hat,k-hatland. - Plot them as three arrows from the origin.
- Those are the three edges of the transformed box (parallelepiped).
Columns nearly coplanar => the box squashes nearly flat => the transformation is collapsing space toward a plane or line.
Pitfalls to dodge
Section titled “Pitfalls to dodge”- “Rotation” without an axis. In 3D you must name the axis you turn around.
- Expecting new rules. None appear in 3D; it is 2D with one more basis vector.
- Reading rows. Meaning is in the columns: three destination vectors.
- Expecting the cube to stay a cube. Only rigid rotation keeps it a cube; stretch, shear, and flatten reshape it.
Words to use precisely
Section titled “Words to use precisely”- k-hat: the third standard basis vector,
[0, 0, 1], along z. - 3x3 matrix: three 3D columns, one each for
i-hat,j-hat,k-hat. - Parallelepiped: the slanted box the unit cube becomes; its edges are the three columns.
The one-line version
Section titled “The one-line version”3D adds a dimension, not a difficulty: one more basis vector, one more column, one more term, and every 2D rule runs unchanged.