CP 3.3 - Successive and 3-D transformations

CP 3.3 - Successive and 3-D transformations

Two transformations combine by matrix multiplication, with the first action written on the right. You will explain that order, calculate matrices for successive transformations, and extend the column-image method to reflections in coordinate planes and rotations about coordinate axes in three dimensions.

The first transformation acts on the right

Start with (1,1)(1,1). Stretch horizontally by scale factor 22, then rotate anticlockwise through π2\frac\pi2 about the origin. Will reversing those two instructions give the same point? Your hands can perform the instructions in either order; matrix multiplication records precisely which order you chose.

You already know

The columns of a transformation matrix are the images of the unit vectors. Matrix products act on column vectors from the left. In two dimensions, R=(0−110)\mathbf{R}=\begin{pmatrix}0&-1\\1&0\end{pmatrix} is a quarter-turn anticlockwise, and S=(2001)\mathbf{S}=\begin{pmatrix}2&0\\0&1\end{pmatrix} is a horizontal stretch of scale factor 22.

Following the point gives (1,1)↦(2,1)↦(−1,2)(1,1)\mapsto(2,1)\mapsto(-1,2). Its algebra is R(Sv)\mathbf{R}(\mathbf{S}\mathbf{v}): the stretch has to reach v\mathbf{v} first. Associativity lets you write this as (RS)v(\mathbf{R}\mathbf{S})\mathbf{v}.

Successive transformations

If B\mathbf{B} represents the first transformation and A\mathbf{A} the second, the combined matrix is

AB,v↦Bv↦ABv\mathbf{A}\mathbf{B},\qquad \mathbf{v}\mapsto\mathbf{B}\mathbf{v}\mapsto\mathbf{A}\mathbf{B}\mathbf{v}

For three transformations, first C\mathbf{C}, then B\mathbf{B}, then A\mathbf{A}, the product is ABC\mathbf{A}\mathbf{B}\mathbf{C}. The orders must be conformable. Not in the formula booklet: learn it.

Writing the point at the far right is a useful way to decide the order. You can then calculate the combined matrix once and reuse it for every point.

Worked example 1: stretch then rotate

Question. A transformation TT is a stretch of scale factor 22 parallel to the xx-axis followed by a rotation through π2\frac\pi2 anticlockwise about the origin. Find its matrix and the image of (1,1)(1,1).

Plan. Write the rotation matrix to the left of the stretch matrix, multiply, then apply the product.

T=RS=(0−110)(2001)stretch acts first=(0−120)row by columnT(11)=(−12)apply the product\begin{aligned} \mathbf{T}&=\mathbf{R}\mathbf{S} =\begin{pmatrix}0&-1\\1&0\end{pmatrix}\begin{pmatrix}2&0\\0&1\end{pmatrix}&&\text{stretch acts first}\\ &=\begin{pmatrix}0&-1\\2&0\end{pmatrix}&&\text{row by column}\\ \mathbf{T}\begin{pmatrix}1\\1\end{pmatrix}&=\begin{pmatrix}-1\\2\end{pmatrix}&&\text{apply the product} \end{aligned}

Why this step? The right-hand factor acts directly on the point, so the chronological first transformation must stand on the right.

Answer. T=(0−120)\mathbf{T}=\begin{pmatrix}0&-1\\2&0\end{pmatrix}, and the image is (−1,2)(-1,2).

Check. Separately, (1,1)↦(2,1)↦(−1,2)(1,1)\mapsto(2,1)\mapsto(-1,2), matching the combined product.

The second example changes one feature: the order of the same two transformations. This isolates exactly what the multiplication order controls.

Worked example 2: rotate then stretch

Question. Find the matrix for the rotation in Worked example 1 followed by its stretch, and find the image of (1,1)(1,1).

Plan. Reverse the factor order, putting the stretch on the left, then transform the point.

U=SR=(2001)(0−110)rotation acts first=(0−210)row by columnU(11)=(−21)apply the product\begin{aligned} \mathbf{U}&=\mathbf{S}\mathbf{R} =\begin{pmatrix}2&0\\0&1\end{pmatrix}\begin{pmatrix}0&-1\\1&0\end{pmatrix}&&\text{rotation acts first}\\ &=\begin{pmatrix}0&-2\\1&0\end{pmatrix}&&\text{row by column}\\ \mathbf{U}\begin{pmatrix}1\\1\end{pmatrix}&=\begin{pmatrix}-2\\1\end{pmatrix}&&\text{apply the product} \end{aligned}

Why this step? The stretch always changes the current horizontal coordinate. After the rotation, that coordinate came from the original vertical coordinate.

Answer. U=(0−210)\mathbf{U}=\begin{pmatrix}0&-2\\1&0\end{pmatrix}, and the image is (−2,1)(-2,1).

Check. Separately, (1,1)↦(−1,1)↦(−2,1)(1,1)\mapsto(-1,1)\mapsto(-2,1). This differs from (−1,2)(-1,2), answering the opening question.

Order matters, but it does not always change the result. There is a useful exception: any enlargement about the origin, kIk\mathbf{I}, commutes with every linear transformation of the same dimension, because (kI)M=kM=M(kI)(k\mathbf{I})\mathbf{M}=k\mathbf{M}=\mathbf{M}(k\mathbf{I}). Scaling the whole picture before or after transforming it gives the same image. A one-direction stretch has no such general guarantee.

Watch out

Wrong: “A\mathbf{A} followed by B\mathbf{B} gives AB\mathbf{A}\mathbf{B}.” Right: it gives BA\mathbf{B}\mathbf{A}. Put a point vector at the right and read which factor touches it first.

The next question changes the first transformation to a reflection; keep the same order reasoning.

Reflections in coordinate planes

In three dimensions, reflection in a coordinate plane changes the sign of the coordinate perpendicular to that plane and leaves the other two unchanged.

You already know

A three-dimensional point (x,y,z)(x,y,z) has position vector (xyz)=xi+yj+zk\begin{pmatrix}x\\y\\z\end{pmatrix}=x\mathbf{i}+y\mathbf{j}+z\mathbf{k}. The plane x=0x=0 contains the yy- and zz-axes; the plane z=0z=0 is the xyxy-plane.

For example, (2,1,3)(2,1,3) lies two units from x=0x=0; its reflection is (−2,1,3)(-2,1,3). Their midpoint (0,1,3)(0,1,3) is in the mirror plane. Nothing has happened to the coordinates parallel to that plane.

The unit-vector idea now uses three columns: the images of i\mathbf{i}, j\mathbf{j} and k\mathbf{k}, in that order.

Coordinate-plane reflections

Reflections in x=0x=0, y=0y=0 and z=0z=0 have matrices, respectively,

(−100010001),(1000−10001),(10001000−1)\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix},\qquad \begin{pmatrix}1&0&0\\0&-1&0\\0&0&1\end{pmatrix},\qquad \begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}

Not in the formula booklet: learn it.

Identify the plane by the coordinate that changes sign, rather than guessing from a drawing in perspective.

Worked example 3: reflection in x equals zero

Question. Find the matrix for reflection in x=0x=0, and the image of P=(2,−1,4)P=(2,-1,4).

Plan. Negate the first coordinate and retain the other two, then write and use the three unit-vector columns.

i↦−i,j↦j,k↦kreflect the unit vectorsF=(−100010001)images form columnsF(2−14)=(−2−14)apply the matrix\begin{aligned} \mathbf{i}&\mapsto-\mathbf{i},\quad\mathbf{j}\mapsto\mathbf{j},\quad\mathbf{k}\mapsto\mathbf{k}&&\text{reflect the unit vectors}\\ \mathbf{F}&=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}&&\text{images form columns}\\ \mathbf{F}\begin{pmatrix}2\\-1\\4\end{pmatrix}&=\begin{pmatrix}-2\\-1\\4\end{pmatrix}&&\text{apply the matrix} \end{aligned}

Why this step? The xx-direction is perpendicular to x=0x=0, so only that displacement reverses.

Answer. F=(−100010001)\mathbf{F}=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}, and P′=(−2,−1,4)P'=(-2,-1,4).

Check. The midpoint is (0,−1,4)(0,-1,4), and PP′PP' is parallel to the xx-axis, perpendicular to the mirror plane.

The second example changes only the mirror plane. The last coordinate now reverses instead of the first.

Worked example 4: reflection in z equals zero

Question. Find the matrix for reflection in z=0z=0, and the image of (2,−1,4)(2,-1,4).

Plan. Keep the first two unit vectors fixed and reverse the third, then multiply.

i↦i,j↦j,k↦−kmirror is the xy-planeG=(10001000−1)unit-vector columnsG(2−14)=(2−1−4)apply the matrix\begin{aligned} \mathbf{i}&\mapsto\mathbf{i},\quad\mathbf{j}\mapsto\mathbf{j},\quad\mathbf{k}\mapsto-\mathbf{k}&&\text{mirror is the }xy\text{-plane}\\ \mathbf{G}&=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}&&\text{unit-vector columns}\\ \mathbf{G}\begin{pmatrix}2\\-1\\4\end{pmatrix}&=\begin{pmatrix}2\\-1\\-4\end{pmatrix}&&\text{apply the matrix} \end{aligned}

Why this step? Reflection in a plane keeps both directions within the plane; negating all three coordinates would be a different transformation.

Answer. G=(10001000−1)\mathbf{G}=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}, and the image is (2,−1,−4)(2,-1,-4).

Check. The midpoint (2,−1,0)(2,-1,0) belongs to z=0z=0, and both points are four units from it.

The picture separates the perpendicular displacement from the two coordinates that stay fixed.

[DIAGRAM: asset_name: Reflection in a three-dimensional coordinate plane; asset_slug: 9fm0-cp17-plane-reflection; caption: Reflection in x equals zero reverses the perpendicular coordinate only; description: A three-dimensional coordinate diagram shows the translucent plane x equals zero and the points (2, -1, 4) and (-2, -1, 4), joined through their midpoint (0, -1, 4). The x, y and z directions are labelled.]
Reflection in x equals zero reverses the perpendicular coordinate only

Watch out

Wrong: call x=0x=0 “the xx-axis”. It is a plane containing the other two axes. Right: describe this transformation as reflection in the plane x=0x=0, or the yzyz-plane.

For a different coordinate plane, locate the perpendicular direction first.

Rotations about coordinate axes

A rotation about a coordinate axis leaves that coordinate unchanged and rotates the other two in their perpendicular plane.

Direction needs a viewpoint. Here a positive rotation is anticlockwise when viewed from the positive end of the rotation axis towards the origin. This gives the right-hand convention: a positive turn takes i\mathbf{i} towards j\mathbf{j} about zz, j\mathbf{j} towards k\mathbf{k} about xx, and k\mathbf{k} towards i\mathbf{i} about yy. If a question specifies a different viewing direction, translate its instruction before selecting the angle's sign.

For a rotation about zz, the xyxy-coordinates follow the familiar two-dimensional rotation, while zz stays fixed. The same reasoning works cyclically in the yzyz- and zxzx-planes.

Coordinate-axis rotations

Write c=cos⁡θc=\cos\theta, s=sin⁡θs=\sin\theta, using the positive viewing convention above. Rotations about the xx-, yy- and zz-axes are

Rx(θ)=(1000c−s0sc)\mathbf{R}_x(\theta)=\begin{pmatrix}1&0&0\\0&c&-s\\0&s&c\end{pmatrix} Ry(θ)=(c0s010−s0c),Rz(θ)=(c−s0sc0001)\mathbf{R}_y(\theta)=\begin{pmatrix}c&0&s\\0&1&0\\-s&0&c\end{pmatrix},\qquad \mathbf{R}_z(\theta)=\begin{pmatrix}c&-s&0\\s&c&0\\0&0&1\end{pmatrix}

The two-dimensional rotation matrix is supplied, but these three-dimensional forms are not. Not in the formula booklet: learn it.

The signs in the yy-axis matrix deserve attention: the rotating pair is (z,x)(z,x) in cyclic order, rather than (x,z)(x,z). For a positive quarter-turn it sends k\mathbf{k} to i\mathbf{i} and i\mathbf{i} to −k-\mathbf{k}, while keeping j\mathbf{j}.

Worked example 5: rotation about the z-axis

Question. Rotate (1,2,3)(1,2,3) through π2\frac\pi2 anticlockwise about the zz-axis, viewed from positive zz towards the origin. Find the matrix and image.

Plan. Use the two-dimensional quarter-turn on (x,y)(x,y), leaving zz unchanged.

Rz(π2)=(0−10100001)c=0, s=1Rz(π2)(123)=(−213)row by column\begin{aligned} \mathbf{R}_z\left(\frac\pi2\right)&=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}&&c=0,\ s=1\\ \mathbf{R}_z\left(\frac\pi2\right)\begin{pmatrix}1\\2\\3\end{pmatrix}&=\begin{pmatrix}-2\\1\\3\end{pmatrix}&&\text{row by column} \end{aligned}

Why this step? A point moves around the zz-axis in a plane of constant zz, so the last row must leave that coordinate unchanged.

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

Check. The zz-coordinate is still 33, and the squared distance from the axis is still x2+y2=5x^2+y^2=5.

The second example changes only the rotation axis, retaining the same angle, viewing convention and point. The fixed coordinate therefore changes.

Worked example 6: rotation about the x-axis

Question. Rotate (1,2,3)(1,2,3) through π2\frac\pi2 anticlockwise about the xx-axis, viewed from positive xx towards the origin. Find the matrix and image.

Plan. Fix xx and apply a positive quarter-turn to the ordered pair (y,z)(y,z).

Rx(π2)=(10000−1010)c=0, s=1Rx(π2)(123)=(1−32)rotate (y,z)↦(−z,y)\begin{aligned} \mathbf{R}_x\left(\frac\pi2\right)&=\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}&&c=0,\ s=1\\ \mathbf{R}_x\left(\frac\pi2\right)\begin{pmatrix}1\\2\\3\end{pmatrix}&=\begin{pmatrix}1\\-3\\2\end{pmatrix}&&\text{rotate }(y,z)\mapsto(-z,y) \end{aligned}

Why this step? The xx-coordinate belongs to the rotation axis, so it is the first coordinate that stays fixed this time.

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

Check. The squared distance from the xx-axis remains y2+z2=13y^2+z^2=13, and the first coordinate remains 11.

The coordinate along the rotation axis supplies a quick check on the answer.

Watch out

Wrong: the stated positive quarter-turn about the xx-axis sends (1,2,3)(1,2,3) to (−1,−3,2)(-1,-3,2). Rotation about that axis must keep xx unchanged. The correct image is (1,−3,2)(1,-3,2), from (x,y,z)↦(x,−z,y)(x,y,z)\mapsto(x,-z,y).

For other angles, the same matrices give, for example, Rx(θ)(x,y,z)T=(x,cy−sz,sy+cz)T\mathbf{R}_x(\theta)(x,y,z)^{\mathsf T}=(x,cy-sz,sy+cz)^{\mathsf T}. You can check the unchanged coordinate and the perpendicular distance without needing a complicated perspective sketch.

Problem-solving

For a three-dimensional rotation, first identify the fixed coordinate, then the direction of the turn from the stated viewpoint. Test one unit vector before transforming the whole point.

The opening two operations do give different answers: (−1,2)(-1,2) and (−2,1)(-2,1). The geometric reason is that the horizontal stretch acts on a different direction after a quarter-turn. The product order captures that difference automatically.

Quick Recap

  • AB\mathbf{A}\mathbf{B} means B\mathbf{B} first, then A\mathbf{A}; reversing the order may change the result.
  • In three dimensions, the images of i\mathbf{i}, j\mathbf{j}, k\mathbf{k} form the three columns.
  • Reflection in a coordinate plane reverses the perpendicular coordinate only.
  • Rotation about a coordinate axis leaves that coordinate fixed. State the viewing direction when describing the turn.

Stretch then rotate sends (1,1)(1,1) to (−1,2)(-1,2); rotate then stretch sends it to (−2,1)(-2,1). The two instructions do not commute.