Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find the Matrix of a Geometric Transformation

Rotations, reflections, projections, shears and scalings of the plane are linear maps, so each has a 2×22 \times 2 matrix. Find where e1=(1,0)\mathbf{e}_1 = (1, 0) and e2=(0,1)\mathbf{e}_2 = (0, 1) land, or use the family formula; to combine several moves, multiply the matrices with the first move on the right.

Recognize the task

A description in words: "rotate by 60°60°", "reflect across y=2xy = 2x", "project onto the line y=2xy = 2x", "shear horizontally by 22", "rotate, then reflect". Test: the map must fix the origin; a rotation about another point, or a translation, is not linear.
The families are catalogued in How to Read a Transformation Matrix; composing them is Combining Transformations.

Ways to do it

Track the basis vectorsany description
A=[ T(e1) T(e2) ]A = [\,T(\mathbf{e}_1) \ T(\mathbf{e}_2)\,]
Sketch where (1,0)(1, 0) and (0,1)(0, 1) go, as in finding the transformation matrix.
Family formulasrotation, reflection
Rθ=(cos⁡θ−sin⁡θsin⁡θcos⁡θ),Fϕ=(cos⁡2ϕsin⁡2ϕsin⁡2ϕ−cos⁡2ϕ)R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}, \quad F_\phi = \begin{pmatrix} \cos 2\phi & \sin 2\phi \\ \sin 2\phi & -\cos 2\phi \end{pmatrix}
The rotation matrix turns counterclockwise by θ\theta; the reflection across a line uses the line's angle ϕ\phi to the xx-axis.
Projection formulaonto a line
P=uuTuTu,F=2P−IP = \frac{\mathbf{u}\mathbf{u}^T}{\mathbf{u}^T\mathbf{u}}, \quad F = 2P - I
The projection onto the line through u\mathbf{u}; the reflection across the same line is 2P−I2P - I.

Steps

StepOn "rotate 90°90° counterclockwise, then reflect across the xx-axis"
1Split the description into single moves. List them in the order they happen.first RR (rotate 90°90°), then FF (reflect across the xx-axis)
2Write each matrix. Track e1\mathbf{e}_1 and e2\mathbf{e}_2, or use the family formula.R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, F=(100−1)F = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
3Multiply with the first move on the right. T(x)=F(Rx)T(\mathbf{x}) = F(R\mathbf{x}), so the matrix is FRFR: the composition of linear maps is a matrix product.FR=(0−1−10)FR = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}
4Check on a basis vector. Follow e1\mathbf{e}_1 through each move by hand.(1,0)→(0,1)→(0,−1)(1, 0) \to (0, 1) \to (0, -1), which is column 1 of FRFR ✓
5Identify the result by its determinant. A determinant of 11 means rotation or shear, −1-1 a reflection, 00 a projection; ∣det⁡∣|\det| is the area scale factor.det⁡(FR)=−1\det(FR) = -1: a reflection, across y=−xy = -x

Worked examples

Example 1 · rotation by 60°

rotation
R60°=(12−323212)R_{60°} = \begin{pmatrix} \frac{1}{2} & -\frac{\sqrt{3}}{2} \\ \frac{\sqrt{3}}{2} & \frac{1}{2} \end{pmatrix}
cos⁡60°=12\cos 60° = \frac{1}{2}, sin⁡60°=32\sin 60° = \frac{\sqrt{3}}{2}
R60°(2,0)=(1,3)R_{60°}(2, 0) = (1, \sqrt{3})
length 22 is kept

Example 2 · reflection across y = 2x

reflection
u=(1,2)\mathbf{u} = (1, 2): P=15(1224)P = \frac{1}{5}\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}
projection onto the line
F=2P−I=15(−3443)F = 2P - I = \frac{1}{5}\begin{pmatrix} -3 & 4 \\ 4 & 3 \end{pmatrix}
det⁡F=−1\det F = -1
F(5,0)=(−3,4)F(5, 0) = (-3, 4), and F(1,2)=(1,2)F(1, 2) = (1, 2) ✓
points on the line stay

Example 3 · shear, then rotate

composition
S=(1201)S = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} first, then R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}
shear, then rotate 90°90°
RS=(0−112)RS = \begin{pmatrix} 0 & -1 \\ 1 & 2 \end{pmatrix}
first move on the right
RS(1,1)=(−1,3)RS(1, 1) = (-1, 3); by hand S(1,1)=(3,1)S(1, 1) = (3, 1), R(3,1)=(−1,3)R(3, 1) = (-1, 3) ✓
Try the order both ways in the matrix composition 2D visualizer, and reflections in the reflection 2D visualizer.

See it happen

Picture the unit square with corners 0\mathbf{0}, e1\mathbf{e}_1, e2\mathbf{e}_2 and e1+e2\mathbf{e}_1 + \mathbf{e}_2. A geometric map moves it to a parallelogram whose two edges from the origin are the columns of the matrix. Rotations and reflections keep it a unit square, a shear leans it, a projection flattens it onto a line, and the determinant records the signed area of what is left. The linear transformation 2D visualizer draws that parallelogram for any matrix.

Common mistakes

Multiplying in reading order

✗ "rotate, then reflect" =RF=(0110)= RF = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
✓ FR=(0−1−10)FR = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}: the first move sits next to x\mathbf{x}
RFRF is the reflection across y=xy = x, a different map.

Clockwise for counterclockwise

✗ R90°=(01−10)R_{90°} = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}
✓ counterclockwise is (0−110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}; the matrix on the left turns clockwise

Not doubling the reflection angle

✗ reflection across the line at angle ϕ\phi: (cos⁡ϕsin⁡ϕsin⁡ϕ−cos⁡ϕ)\begin{pmatrix} \cos\phi & \sin\phi \\ \sin\phi & -\cos\phi \end{pmatrix}
✓ the entries use 2ϕ2\phi: (cos⁡2ϕsin⁡2ϕsin⁡2ϕ−cos⁡2ϕ)\begin{pmatrix} \cos 2\phi & \sin 2\phi \\ \sin 2\phi & -\cos 2\phi \end{pmatrix}

Projection mixed up with reflection

✗ projecting (5,0)(5, 0) onto y=2xy = 2x gives (−3,4)(-3, 4)
✓ the projection gives P(5,0)=(1,2)P(5, 0) = (1, 2); (−3,4)(-3, 4) is the reflection