CP 3.3 - Matrices for 2-D transformations

CP 3.3 - Matrices for 2-D transformations

A transformation matrix turns a geometric instruction into a calculation on coordinates. You will build and recognise matrices for reflections, rotations, stretches and enlargements in two dimensions, and use the images of two simple vectors to explain their entries.

Building a matrix from two images

A point P=(2,3)P=(2,3) is reflected in the line y=−xy=-x. Can you write one matrix that reflects every point in that line? Finding where (1,0)(1,0) and (0,1)(0,1) go will do the whole job.

You already know

A point (x,y)(x,y) has position vector (xy)\begin{pmatrix}x\\y\end{pmatrix}. Matrix multiplication uses rows from the left factor and columns from the right. From coordinate geometry, reflection in y=xy=x swaps the coordinates.

Take M=(abcd)\mathbf{M}=\begin{pmatrix}a&b\\c&d\end{pmatrix}. Applying it to the two unit vectors gives

M(10)=(ac),M(01)=(bd)\mathbf{M}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}a\\c\end{pmatrix},\qquad \mathbf{M}\begin{pmatrix}0\\1\end{pmatrix}=\begin{pmatrix}b\\d\end{pmatrix}

These images are the first and second columns. Since (xy)=x(10)+y(01)\begin{pmatrix}x\\y\end{pmatrix}=x\begin{pmatrix}1\\0\end{pmatrix}+y\begin{pmatrix}0\\1\end{pmatrix}, their images determine every other image by the same linear combination.

Linear transformation

A linear transformation preserves addition and scalar multiplication: T(u+v)=T(u)+T(v)T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v}) and T(ku)=kT(u)T(k\mathbf{u})=kT(\mathbf{u}). A matrix acting on column vectors gives such a transformation. In particular, the origin stays at the origin. A non-zero translation is not represented by a 2×22\times2 matrix acting on (xy)\begin{pmatrix}x\\y\end{pmatrix}, because it moves the origin.

For the four required reflections, track what happens to each coordinate. The images of the unit vectors then give these matrices:

Mirror lineCoordinate ruleMatrix
y=0y=0, the xx-axis(x,y)↦(x,−y)(x,y)\mapsto(x,-y)(100−1)\begin{pmatrix}1&0\\0&-1\end{pmatrix}
x=0x=0, the yy-axis(x,y)↦(−x,y)(x,y)\mapsto(-x,y)(−1001)\begin{pmatrix}-1&0\\0&1\end{pmatrix}
y=xy=x(x,y)↦(y,x)(x,y)\mapsto(y,x)(0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}
y=−xy=-x(x,y)↦(−y,−x)(x,y)\mapsto(-y,-x)(0−1−10)\begin{pmatrix}0&-1\\-1&0\end{pmatrix}

The columns-as-images rule is not in the formula booklet: learn it. The booklet does give a reflection matrix from which the non-vertical mirror cases can be obtained.

Reflection in a line through the origin

For a mirror line y=(tan⁡θ)xy=(\tan\theta)x,

M=(cos⁡2θsin⁡2θsin⁡2θ−cos⁡2θ)\mathbf{M}=\begin{pmatrix}\cos2\theta&\sin2\theta\\\sin2\theta&-\cos2\theta\end{pmatrix}

The line makes angle θ\theta with the positive xx-axis. Use the direct coordinate rule for the vertical mirror line. In the formula booklet.

A full description names the transformation and the mirror line. “Reflection” by itself leaves the geometry incomplete.

Worked example 1: reflection in a coordinate axis

Question. Find the matrix for reflection in the yy-axis, and use it to find the image of (3,−2)(3,-2).

Plan. Find the images of the two unit vectors, place them in columns, then multiply by the point's column vector.

(1,0)↦(−1,0),(0,1)↦(0,1)reflect horizontallyM=(−1001)images are columnsM(3−2)=(−3−2)row by column\begin{aligned} (1,0)&\mapsto(-1,0),\quad(0,1)\mapsto(0,1)&&\text{reflect horizontally}\\ \mathbf{M}&=\begin{pmatrix}-1&0\\0&1\end{pmatrix}&&\text{images are columns}\\ \mathbf{M}\begin{pmatrix}3\\-2\end{pmatrix}&=\begin{pmatrix}-3\\-2\end{pmatrix}&&\text{row by column} \end{aligned}

Why this step? Reflection in the yy-axis reverses horizontal displacement, so it changes the xx-coordinate, despite the axis being named after yy.

Answer. The matrix is (−1001)\begin{pmatrix}-1&0\\0&1\end{pmatrix}, and the image is (−3,−2)(-3,-2).

Check. The midpoint of the point and image is (0,−2)(0,-2), on the mirror line, and their joining segment is perpendicular to it.

The next example changes the mirror line to a diagonal. Both unit-vector images now move, so the non-zero entries sit off the main diagonal.

Worked example 2: reflection in a diagonal line

Question. Determine the matrix for reflection in y=−xy=-x, and find the image of P=(2,3)P=(2,3).

Plan. Use (x,y)↦(−y,−x)(x,y)\mapsto(-y,-x) to obtain the two matrix columns, then apply the matrix to PP.

(1,0)↦(0,−1),(0,1)↦(−1,0)reflect the unit vectorsM=(0−1−10)columns in that orderM(23)=(−3−2)apply to P\begin{aligned} (1,0)&\mapsto(0,-1),\quad(0,1)\mapsto(-1,0)&&\text{reflect the unit vectors}\\ \mathbf{M}&=\begin{pmatrix}0&-1\\-1&0\end{pmatrix}&&\text{columns in that order}\\ \mathbf{M}\begin{pmatrix}2\\3\end{pmatrix}&=\begin{pmatrix}-3\\-2\end{pmatrix}&&\text{apply to }P \end{aligned}

Why this step? Swapping alone reflects in y=xy=x. Reflection in y=−xy=-x swaps and negates both coordinates.

Answer. M=(0−1−10)\mathbf{M}=\begin{pmatrix}0&-1\\-1&0\end{pmatrix}, and P′=(−3,−2)P'=(-3,-2).

Check. The midpoint is (−12,12)(-\frac12,\frac12), on y=−xy=-x. The joining segment has gradient 11, perpendicular to the mirror's gradient −1-1.

The two points sit the same perpendicular distance from the mirror. This geometric check catches a wrong sign immediately.

[DIAGRAM: asset_name: Reflection of a point in y equals minus x; asset_slug: 9fm0-cp16-reflection; caption: Reflection in y equals minus x swaps and negates the two coordinates; description: Equal-scale coordinate axes show P at (2, 3) and P prime at (-3, -2), joined by a dashed segment perpendicular to the mirror line y equals minus x. Their midpoint (-0.5, 0.5) lies on the mirror. Unit vectors and their reflected images show the two columns of the matrix.]
Reflection in y equals minus x swaps and negates the two coordinates

Watch out

Wrong: “(−1001)\begin{pmatrix}-1&0\\0&1\end{pmatrix} reflects in the xx-axis because its first entry is negative.” Right: it changes xx and keeps yy, so its mirror is the yy-axis. Test (1,0)(1,0) if you are unsure.

Try a different diagonal, keeping the column method.

Rotations through any angle

A rotation about the origin moves both unit vectors through the same angle, preserving their lengths and the right angle between them.

You already know

On the unit circle, the point at angle θ\theta has coordinates (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta). Positive angles are anticlockwise. Exact trigonometric values and the identities cos⁡(−θ)=cos⁡θ\cos(-\theta)=\cos\theta, sin⁡(−θ)=−sin⁡θ\sin(-\theta)=-\sin\theta let you handle clockwise angles.

After an anticlockwise turn through θ\theta, the first unit vector becomes (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta). The second starts a quarter-turn further round, so its image is (−sin⁡θ,cos⁡θ)(-\sin\theta,\cos\theta). Put these vectors in columns:

Rotation about the origin

An anticlockwise rotation through angle θ\theta about (0,0)(0,0) has matrix

R(θ)=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)\mathbf{R}(\theta)=\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}

A clockwise rotation through α>0\alpha>0 uses θ=−α\theta=-\alpha. In the formula booklet.

Read the first column as a quick orientation check. For θ=π2\theta=\frac\pi2, (1,0)(1,0) must go to (0,1)(0,1), not (0,−1)(0,-1).

Worked example 3: an exact anticlockwise rotation

Question. Find the matrix for rotation through π3\frac\pi3 anticlockwise about the origin, and the image of (2,0)(2,0).

Plan. Substitute the exact sine and cosine values, then multiply by the point's position vector.

R=(12−323212)cos⁡π3=12, sin⁡π3=32R(20)=(13)twice the first column\begin{aligned} \mathbf{R}&=\begin{pmatrix}\frac12&-\frac{\sqrt3}{2}\\\frac{\sqrt3}{2}&\frac12\end{pmatrix}&&\cos\frac\pi3=\frac12,\ \sin\frac\pi3=\frac{\sqrt3}{2}\\ \mathbf{R}\begin{pmatrix}2\\0\end{pmatrix}&=\begin{pmatrix}1\\\sqrt3\end{pmatrix}&&\text{twice the first column} \end{aligned}

Why this step? Exact surds preserve the exact rotation; rounded entries would only approximate it.

Answer. The matrix is (12−323212)\begin{pmatrix}\frac12&-\frac{\sqrt3}{2}\\\frac{\sqrt3}{2}&\frac12\end{pmatrix}, and the image is (1,3)(1,\sqrt3).

Check. The distance from the origin is still 1+3=2\sqrt{1+3}=2, and the image lies above the positive xx-axis.

The second example changes the angle to a clockwise one. Only the angle input changes; there is no separate rule to memorise.

Worked example 4: a clockwise rotation

Question. Find the matrix for rotation through π6\frac\pi6 clockwise about the origin, and use it to transform (2,0)(2,0).

Plan. Use θ=−π6\theta=-\frac\pi6, keeping the two sine entries' signs distinct.

cos⁡θ=32,sin⁡θ=−12negative angleR=(3212−1232)substitute into the formulaR(20)=(3−1)matrix multiplication\begin{aligned} \cos\theta&=\frac{\sqrt3}{2},\qquad\sin\theta=-\frac12&&\text{negative angle}\\ \mathbf{R}&=\begin{pmatrix}\frac{\sqrt3}{2}&\frac12\\-\frac12&\frac{\sqrt3}{2}\end{pmatrix}&&\text{substitute into the formula}\\ \mathbf{R}\begin{pmatrix}2\\0\end{pmatrix}&=\begin{pmatrix}\sqrt3\\-1\end{pmatrix}&&\text{matrix multiplication} \end{aligned}

Why this step? The upper-right entry is −sin⁡θ-\sin\theta, so a negative sine makes that entry positive.

Answer. The matrix is (3212−1232)\begin{pmatrix}\frac{\sqrt3}{2}&\frac12\\-\frac12&\frac{\sqrt3}{2}\end{pmatrix}, and the image is (3,−1)(\sqrt3,-1).

Check. The image has length 3+1=2\sqrt{3+1}=2 and lies below the positive xx-axis, as a clockwise turn requires.

Both pictures use the same radius, so the effect of the sign is visible.

[DIAGRAM: asset_name: Positive and negative rotation angles; asset_slug: 9fm0-cp16-rotations; caption: Positive angles turn anticlockwise; negative angles turn clockwise; description: Two equal-scale coordinate panels show the vector (2, 0). The left panel rotates it anticlockwise by pi over 3 to (1, root 3); the right rotates it clockwise by pi over 6 to (root 3, -1). Arcs have arrowheads and endpoints are labelled.]
Positive angles turn anticlockwise

Watch out

Wrong: use a positive π6\frac\pi6 in the anticlockwise formula for a clockwise turn. Right: substitute −π6-\frac\pi6. Checking the image of (1,0)(1,0) tells you which way the matrix turns.

A complete description gives the centre, angle and direction; a matrix alone does not supply those words for you.

Stretches and enlargements

A stretch changes one coordinate scale; an enlargement changes both by the same factor.

If horizontal distances are tripled while vertical distances stay the same, then (x,y)↦(3x,y)(x,y)\mapsto(3x,y). The unit vectors go to (3,0)(3,0) and (0,1)(0,1), giving (3001)\begin{pmatrix}3&0\\0&1\end{pmatrix}. A vertical stretch with factor 22 instead sends (x,y)(x,y) to (x,2y)(x,2y), giving (1002)\begin{pmatrix}1&0\\0&2\end{pmatrix}.

Stretches and enlargement

A stretch of scale factor kk parallel to the xx-axis or yy-axis has matrix, respectively,

(k001),(100k)\begin{pmatrix}k&0\\0&1\end{pmatrix},\qquad \begin{pmatrix}1&0\\0&k\end{pmatrix}

An enlargement of centre (0,0)(0,0) and real scale factor k≠0k\ne0 has matrix

(k00k)=kI2\begin{pmatrix}k&0\\0&k\end{pmatrix}=k\mathbf{I}_2

A negative scale factor reverses the affected coordinate direction. Not in the formula booklet: learn it.

A scale factor between 00 and 11 reduces distances in the relevant direction. The word “stretch” describes the transformation family, not a promise that the picture gets bigger. An enlargement with k=−1k=-1 is exactly a half-turn: both send every (x,y)(x,y) to (−x,−y)(-x,-y). Two quite different descriptions can name the same transformation.

Worked example 5: stretching in one direction

Question. Describe fully the transformation represented by S=(3001)\mathbf{S}=\begin{pmatrix}3&0\\0&1\end{pmatrix}, and find the image of (2,−1)(2,-1).

Plan. Read the coordinate rule from the product with (xy)\begin{pmatrix}x\\y\end{pmatrix}, then substitute the point.

S(xy)=(3xy)read the two rowsS(2−1)=(6−1)apply to the point\begin{aligned} \mathbf{S}\begin{pmatrix}x\\y\end{pmatrix}&=\begin{pmatrix}3x\\y\end{pmatrix}&&\text{read the two rows}\\ \mathbf{S}\begin{pmatrix}2\\-1\end{pmatrix}&=\begin{pmatrix}6\\-1\end{pmatrix}&&\text{apply to the point} \end{aligned}

Why this step? Only xx is multiplied by 33, so this is a stretch parallel to the xx-axis, rather than an enlargement.

Answer. A stretch of scale factor 33 parallel to the xx-axis; the image is (6,−1)(6,-1).

Check. The horizontal displacement from the yy-axis triples, while the vertical coordinate remains −1-1.

The next example changes one feature: the same scale factor now acts on both coordinates. The image keeps its direction from the origin.

Worked example 6: scaling both coordinates

Question. Describe fully the transformation represented by E=(3003)\mathbf{E}=\begin{pmatrix}3&0\\0&3\end{pmatrix}, and find the image of (2,−1)(2,-1).

Plan. Read the common diagonal factor, state the centre and scale factor, then transform the point.

E(xy)=3(xy)same factor in both rowsE(2−1)=(6−3)multiply both coordinates\begin{aligned} \mathbf{E}\begin{pmatrix}x\\y\end{pmatrix}&=3\begin{pmatrix}x\\y\end{pmatrix}&&\text{same factor in both rows}\\ \mathbf{E}\begin{pmatrix}2\\-1\end{pmatrix}&=\begin{pmatrix}6\\-3\end{pmatrix}&&\text{multiply both coordinates} \end{aligned}

Why this step? A common multiplier of the position vector scales every distance from the origin, so the origin is the enlargement's centre.

Answer. An enlargement of centre (0,0)(0,0) and scale factor 33; the image is (6,−3)(6,-3).

Check. The original distance is 5\sqrt5, and the image distance is 45=35\sqrt{45}=3\sqrt5. Both points lie on y=−12xy=-\frac12x.

Check whether the scale factor acts on one coordinate or both.

Watch out

Wrong: (3001)\begin{pmatrix}3&0\\0&1\end{pmatrix} is an enlargement of scale factor 33. It leaves the vertical coordinate unchanged. The correct description is a stretch of scale factor 33 parallel to the xx-axis; enlargement by 33 uses (3003)\begin{pmatrix}3&0\\0&3\end{pmatrix}.

If k<0k<0, use the signed factor for coordinates and ∣k∣|k| for the multiplier of distance. For example, −2I2-2\mathbf{I}_2 sends (1,3)(1,3) to (−2,−6)(-2,-6), on the opposite side of the origin at twice the distance.

Exam tip

For an enlargement, state the centre and signed scale factor. For a stretch, state the direction and scale factor. For a reflection, give the mirror line. Pearson asks you to “describe fully”: the missing geometric detail can cost a mark.

The opening reflection is now settled: its columns are (0−1)\begin{pmatrix}0\\-1\end{pmatrix} and (−10)\begin{pmatrix}-1\\0\end{pmatrix}, and it sends (2,3)(2,3) to (−3,−2)(-3,-2).

Quick Recap

  • The images of (1,0)(1,0) and (0,1)(0,1) form the first and second columns of the transformation matrix.
  • Reflections in the axes change one sign; reflection in y=xy=x swaps coordinates, and reflection in y=−xy=-x swaps and negates them.
  • The rotation matrix uses positive angles anticlockwise and negative angles clockwise, about the origin.
  • A stretch scales one coordinate; an enlargement about the origin scales both, with negative factors reversing direction.

The opening question needs (0−1−10)\begin{pmatrix}0&-1\\-1&0\end{pmatrix}: it reflects every point in y=−xy=-x, including (2,3)↦(−3,−2)(2,3)\mapsto(-3,-2).