Linear Transformations in Three Dimensions

I. From Two Dimensions to Three

The core intuition of two dimensions — “each column of a matrix is the image of a basis vector” — extends to three dimensions unchanged.

Three-dimensional space has three standard basis vectors:

ı^=(100),ȷ^=(010),k^=(001)\hat{\imath} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}, \quad \hat{\jmath} = \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}, \quad \hat{k} = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}

Suppose the linear transformation sends the three basis vectors to:

T(ı^)=(adg),T(ȷ^)=(beh),T(k^)=(cfi)T(\hat{\imath}) = \begin{pmatrix} a \\ d \\ g \end{pmatrix}, \quad T(\hat{\jmath}) = \begin{pmatrix} b \\ e \\ h \end{pmatrix}, \quad T(\hat{k}) = \begin{pmatrix} c \\ f \\ i \end{pmatrix}

then the 3×3 matrix is:

M=(abcdefghi)M = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}
  • Column 1 = the image of ı^\hat{\imath}
  • Column 2 = the image of ȷ^\hat{\jmath}
  • Column 3 = the image of k^\hat{k}

II. A Three-Dimensional Matrix Times a Vector

For an arbitrary vector v=(x,y,z)T=xı^+yȷ^+zk^\mathbf{v} = (x, y, z)^T = x\hat{\imath} + y\hat{\jmath} + z\hat{k}:

Mv=x(adg)+y(beh)+z(cfi)=(ax+by+czdx+ey+fzgx+hy+iz)M\mathbf{v} = x\begin{pmatrix} a \\ d \\ g \end{pmatrix} + y\begin{pmatrix} b \\ e \\ h \end{pmatrix} + z\begin{pmatrix} c \\ f \\ i \end{pmatrix} = \begin{pmatrix} ax + by + cz \\ dx + ey + fz \\ gx + hy + iz \end{pmatrix}

It is still “row times column”: the ii-th component of the result = the ii-th row of the matrix multiplied component by component with the vector and then summed.

III. The “Grid” in Three Dimensions

The “grid” of three dimensions is a three-dimensional lattice. A linear transformation turns it into a parallelepiped grid:

  • straight lines are preserved ✅
  • parallelism and equal spacing are preserved ✅
  • the origin stays fixed ✅

The intuitive effect of a three-dimensional linear transformation:

TransformationMatrix (example)Effect
A rotation about the z-axis(cos⁡θ−sin⁡θ0sin⁡θcos⁡θ0001)\begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{pmatrix}turning about the z-axis
Scaling in the x direction(200010001)\begin{pmatrix} 2 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}x stretched by a factor of 2
A shear along the xy plane(101010001)\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}offset according to the z value

A rotation by θ about the z-axis

Rz(θ)=(cos⁡θ−sin⁡θ0sin⁡θcos⁡θ0001)R_z(\theta) = \begin{pmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{pmatrix}

Check: ı^=(1,0,0)→(cos⁡θ,sin⁡θ,0)\hat{\imath} = (1,0,0) \to (\cos\theta, \sin\theta, 0) — the direction of the x-axis after a rotation by θ about the z-axis ✓; k^=(0,0,1)→(0,0,1)\hat{k} = (0,0,1) \to (0,0,1) is unchanged ✓

IV. Composite Transformations in Three Dimensions

The rule for three-dimensional matrix multiplication is exactly the same as in two dimensions (row times column), and it likewise does not satisfy commutativity:

M2M1≠M1M2(in general)M_2 M_1 \neq M_1 M_2 \quad \text{(in general)}

The matrix that acts first is written on the right. For example, the composite matrix for “first rotate about z, then scale” is (the scaling matrix)·(the rotation matrix).

V. Applications: Why Three-Dimensional Linear Transformations Matter

FieldApplication
Computer graphicsthe rotation, scaling and projection of 3D objects all rely on 3×3 matrices (with homogeneous coordinates handling translation)
Roboticsthe transformation matrix of the pose of a robot arm’s end effector
Physicsthe coordinate transformation of tensors and moments of inertia
Machine learningeach layer of a neural network is essentially an “affine transformation” (matrix multiplication plus a bias)

The key trick in computer graphics: multiplying all the vertices of an object first by the “rotation matrix” and then by the “scaling matrix” lets you pre-multiply them into a single matrix, and then perform just one multiplication per vertex — which greatly improves rendering performance.

VI. How to Build Up Three-Dimensional Intuition (suggested practice)

  1. Picture the three basis vectors ı^,ȷ^,k^\hat{\imath}, \hat{\jmath}, \hat{k} pointing along the positive x, y and z axes
  2. Given a 3×3 matrix, look at its three columns and imagine where the three basis vectors each “fly” to
  3. Imagine the whole three-dimensional grid deforming along with the basis vectors
  4. Use “the matrix that acts first is on the right” to derive composite transformations

Summary

Symbols Used in This Article

SymbolTypePronunciation/ExplanationMeaning in This Article
ı^,ȷ^,k^\hat{\imath}, \hat{\jmath}, \hat{k}Mathematical symboli hat, j hat, k hatThe three unit basis vectors of three-dimensional space
M=(abcdefghi)M = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}Mathematical symbol3 by 3 matrixThe 3×3 matrix recording a three-dimensional linear transformation; its three columns are the images of the three basis vectors
MvM\mathbf{v}Mathematical symbolM times vThe three-dimensional matrix times a vector, still computed row by column
Rz(θ)R_z(\theta)Mathematical symbolR z of thetaThe rotation matrix for a rotation by θ\theta about the z-axis
θ\thetaGreek letterThetaThe angle of the rotation about the z-axis
cos⁡θ,sin⁡θ\cos\theta, \sin\thetaMathematical symbolcos theta, sin thetaThe trigonometric terms appearing in the rotation matrix
M2M1≠M1M2M_2 M_1 \neq M_1 M_2Mathematical symbolnot equalThree-dimensional composite transformations likewise do not satisfy commutativity

Found an issue with this content?

Tell us what could be improved.