Skip to content

Cheatsheet: Stepping up to 3D

2D3D
2 basis vectors (i-hat, j-hat)3 basis vectors (i-hat, j-hat, k-hat)
2x2 matrix, columns are 2-vectors3x3 matrix, columns are 3-vectors
M·v = x·col1 + y·col2M·v = x·col1 + y·col2 + z·col3
Unit square becomes a parallelogramUnit 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.

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 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)
TransformationMatrixResult
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.

  1. Read the three columns: where i-hat, j-hat, k-hat land.
  2. Plot them as three arrows from the origin.
  3. 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.

  • “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.
  • 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.

3D adds a dimension, not a difficulty: one more basis vector, one more column, one more term, and every 2D rule runs unchanged.