Pm4, Pm5 - Successive and 3-D transformations

Pm4, Pm5 - Successive and 3-D transformations

Combining two transformations means multiplying their matrices in the correct order. You learn that connection in Pm5, then extend Pm4 to reflections in coordinate planes and quarter-turn multiples about coordinate axes in three dimensions. Unit-vector images keep the larger matrices manageable.

The first transformation goes on the right

If you reflect a point and then rotate it, will reversing those two moves give the same answer?

Start with (2,1)(2,1). Reflecting in the xx-axis gives (2,−1)(2,-1); a 90∘90^\circ anticlockwise rotation then gives (1,2)(1,2). Reverse the moves: the rotation gives (−1,2)(-1,2), and the reflection gives (−1,−2)(-1,-2). The same two instructions have produced different destinations.

You already know

A transformation with matrix M\mathbf{M} sends a column vector r\mathbf{r} to Mr\mathbf{M}\mathbf{r}. The columns are the images of the unit vectors. Matrix multiplication is associative, but its factors cannot generally be exchanged.

Suppose the first transformation has matrix A\mathbf{A} and the second has matrix B\mathbf{B}. The intermediate vector is Ar\mathbf{A}\mathbf{r}, so the final vector is B(Ar)=(BA)r\mathbf{B}(\mathbf{A}\mathbf{r})=(\mathbf{B}\mathbf{A})\mathbf{r}. This derives the order rule rather than leaving it as a memory trick.

Successive transformations

For column position vectors in two dimensions:

first A, then B⟶BA\text{first }\mathbf{A},\ \text{then }\mathbf{B} \quad\longrightarrow\quad\mathbf{B}\mathbf{A}

The rightmost matrix acts first. Thus a matrix AB\mathbf{A}\mathbf{B} represents the transformation associated with B\mathbf{B}, followed by the one associated with A\mathbf{A}.

Not in the formula booklet: learn it.

Writing a short arrow chain beside the product makes it harder to reverse the instructions.

[DIAGRAM: asset_name: Reversing two transformations; asset_slug: transformation_order; caption: Reflection followed by rotation and rotation followed by reflection send the same point to different images; description: Two equal-scale coordinate panels begin with P at 2,1 in blue. The left panel shows reflection in the x-axis to 2,minus1 and then a 90 degree anticlockwise rotation to 1,2 in sage. The right panel shows the rotation first to minus1,2 and then reflection to minus1,minus2 in sage. Intermediate points are clay, and arrows are numbered first and second. Each panel states its matrix order.]
Reflection followed by rotation and rotation followed by reflection send the same point to different images

Worked example 1: reflection followed by rotation

Question. Find the matrix for reflection in the xx-axis followed by rotation centre the origin through 90∘90^\circ anticlockwise. Hence find the image of (2,1)(2,1).

Plan. Write the reflection matrix S\mathbf{S} and rotation matrix R\mathbf{R}, calculate RS\mathbf{R}\mathbf{S}, then apply it to the point.

S=(100−1),R=(0−110)the named transformationsRS=(0110)reflection acts firstRS(21)=(12)apply the combined matrix\begin{aligned} \mathbf{S}&=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\qquad \mathbf{R}=\begin{pmatrix}0&-1\\1&0\end{pmatrix}&&\text{the named transformations}\\ \mathbf{R}\mathbf{S}&=\begin{pmatrix}0&1\\1&0\end{pmatrix}&&\text{reflection acts first}\\ \mathbf{R}\mathbf{S}\begin{pmatrix}2\\1\end{pmatrix}&=\begin{pmatrix}1\\2\end{pmatrix}&&\text{apply the combined matrix} \end{aligned}

Why this step? The first operation must touch the vector first, so S\mathbf{S} belongs next to the vector, on the right of R\mathbf{R}.

Answer. The combined matrix is (0110)\begin{pmatrix}0&1\\1&0\end{pmatrix}, and the image is (1,2)(1,2). This combination is also the single reflection in y=xy=x.

Check. The two-step point calculation is (2,1)↦(2,−1)↦(1,2)(2,1)\mapsto(2,-1)\mapsto(1,2), agreeing with the product.

The next example changes the second transformation from a rotation to a shear. Its full description must include the fixed axis and a point image.

Worked example 2: recognising a combination

Question. Show that N=(1−20−1)\mathbf{N}=\begin{pmatrix}1&-2\\0&-1\end{pmatrix} represents reflection in the xx-axis followed by a shear with the xx-axis fixed, mapping (0,1)(0,1) to (2,1)(2,1). Find the image of (2,1)(2,1).

Plan. Construct each matrix from its description and multiply in the stated order.

S=(100−1),H=(1201)reflection and shearHS=(1(1)+2(0)1(0)+2(−1)0(1)+1(0)0(0)+1(−1))first S, then H=(1−20−1)=Nrequired productN(21)=(0−1)combined image\begin{aligned} \mathbf{S}&=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\qquad \mathbf{H}=\begin{pmatrix}1&2\\0&1\end{pmatrix}&&\text{reflection and shear}\\ \mathbf{H}\mathbf{S}&=\begin{pmatrix}1(1)+2(0)&1(0)+2(-1)\\0(1)+1(0)&0(0)+1(-1)\end{pmatrix}&&\text{first }\mathbf{S},\text{ then }\mathbf{H}\\ &=\begin{pmatrix}1&-2\\0&-1\end{pmatrix}=\mathbf{N}&&\text{required product}\\ \mathbf{N}\begin{pmatrix}2\\1\end{pmatrix}&=\begin{pmatrix}0\\-1\end{pmatrix}&&\text{combined image} \end{aligned}

Why this step? A combined matrix need not itself be one of the named basic matrices. Describing it as two precise transformations is a complete geometric description.

Answer. The product confirms the stated reflection followed by shear. The image is (0,−1)(0,-1).

Check. First (2,1)↦(2,−1)(2,1)\mapsto(2,-1); the shear then gives (2+2(−1),−1)=(0,−1)(2+2(-1),-1)=(0,-1).

There is another pleasant consequence: two reflections can make a rotation. Reflection in the xx-axis followed by reflection in y=xy=x has matrix

(0110)(100−1)=(0−110)\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1&0\\0&-1\end{pmatrix} =\begin{pmatrix}0&-1\\1&0\end{pmatrix}

This is a 90∘90^\circ anticlockwise rotation. Two mirror lines meeting at 45∘45^\circ have produced a turn twice that angle.

Watch out

Wrong: “first A\mathbf{A}, then B\mathbf{B}” gives AB\mathbf{A}\mathbf{B}. Right: the vector follows r↦Ar↦BAr\mathbf{r}\mapsto\mathbf{A}\mathbf{r}\mapsto\mathbf{B}\mathbf{A}\mathbf{r}, so the product is BA\mathbf{B}\mathbf{A}. If the products differ, say that the order of the transformations matters when asked for the geometric significance.

The next combination changes the fixed axis of the shear. Construct it from its unit-vector images before multiplying.

Reflections in coordinate planes

In three dimensions, a coordinate-plane reflection reverses one coordinate and leaves the other two unchanged.

The plane x=0x=0 is the yzyz-plane. Reflecting (2,−1,3)(2,-1,3) in it gives (−2,−1,3)(-2,-1,3): only the perpendicular distance, measured in the xx-direction, changes sign. The planes y=0y=0 and z=0z=0 work in the same way.

Three-dimensional transformation matrix

For a linear transformation in three dimensions, columns 11, 22 and 33 of its 3×33\times3 matrix are the images of (100)\begin{pmatrix}1\\0\\0\end{pmatrix}, (010)\begin{pmatrix}0\\1\\0\end{pmatrix} and (001)\begin{pmatrix}0\\0\\1\end{pmatrix}, respectively. The image of r=(xyz)\mathbf{r}=\begin{pmatrix}x\\y\\z\end{pmatrix} is Mr\mathbf{M}\mathbf{r}.

These three columns have exactly the same role as the two unit-vector images in the plane. Each coordinate-plane reflection reverses one of them.

Coordinate-plane reflection matrices

The matrices for reflection in the three coordinate planes are

x=0:(−100010001)y=0:(1000−10001)z=0:(10001000−1)\begin{aligned} x=0:&\quad\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}\\[2mm] y=0:&\quad\begin{pmatrix}1&0&0\\0&-1&0\\0&0&1\end{pmatrix}\\[2mm] z=0:&\quad\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix} \end{aligned}

The negative entry is in the coordinate perpendicular to the reflecting plane.

Not in the formula booklet: learn it.

The plane's equation tells you which coordinate is perpendicular; there is no need to rely on a perspective sketch.

Worked example 3: reflecting in the yz-plane

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

Plan. Reverse the first unit vector and retain the other two as matrix columns.

M=(−100010001)only x changes signM(2−13)=(−2−13)rows by columns\begin{aligned} \mathbf{M}&=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}&&\text{only }x\text{ changes sign}\\ \mathbf{M}\begin{pmatrix}2\\-1\\3\end{pmatrix}&=\begin{pmatrix}-2\\-1\\3\end{pmatrix}&&\text{rows by columns} \end{aligned}

Why this step? Reflection in x=0x=0 fixes every point whose first coordinate is zero, so the other two coordinates must remain unchanged.

Answer. Matrix (−100010001)\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}; image (−2,−1,3)(-2,-1,3).

Check. The midpoint is (0,−1,3)(0,-1,3), in the mirror plane, and the point-image segment is perpendicular to that plane.

The next example changes only the negative diagonal position. Read it back into a geometric description.

Worked example 4: identifying the reflecting plane

Question. Specify fully the transformation associated with N=(10001000−1)\mathbf{N}=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}, and find the image of (2,−1,3)(2,-1,3).

Plan. Identify the changed coordinate and the plane on which every point stays fixed.

N(xyz)=(xy−z)read the coordinate rulez=0⟹(x,y,0)↦(x,y,0)fixed planeN(2−13)=(2−1−3)apply the rule\begin{aligned} \mathbf{N}\begin{pmatrix}x\\y\\z\end{pmatrix}&=\begin{pmatrix}x\\y\\-z\end{pmatrix}&&\text{read the coordinate rule}\\ z=0&\Longrightarrow(x,y,0)\mapsto(x,y,0)&&\text{fixed plane}\\ \mathbf{N}\begin{pmatrix}2\\-1\\3\end{pmatrix}&=\begin{pmatrix}2\\-1\\-3\end{pmatrix}&&\text{apply the rule} \end{aligned}

Why this step? Two coordinates staying unchanged identify a reflection in a plane, rather than a half-turn about an axis.

Answer. Reflection in the plane z=0z=0; image (2,−1,−3)(2,-1,-3).

Check. The midpoint (2,−1,0)(2,-1,0) lies in z=0z=0; both points are distance 33 from that plane.

A coordinate axis and a coordinate plane have different dimensions, so their names cannot be exchanged.

Watch out

Wrong: diag⁡(1,−1,−1)\operatorname{diag}(1,-1,-1) is reflection in x=0x=0. That reflection reverses xx only. Right: diag⁡(−1,1,1)\operatorname{diag}(-1,1,1) reflects in x=0x=0; diag⁡(1,−1,−1)\operatorname{diag}(1,-1,-1) instead makes a half-turn about the xx-axis.

The next matrix has its single negative entry in the remaining position.

Quarter-turn multiples about coordinate axes

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

For a positive rotation, look towards the origin from the positive side of the rotation axis: positive means anticlockwise in that view. Looking from the other end reverses what appears clockwise, which is why the viewing direction matters.

For a positive quarter-turn, the coordinate directions cycle as follows:

Rotation axisUnchanged directionQuarter-turn imagesxe1e2↦e3,e3↦−e2ye2e3↦e1,e1↦−e3ze3e1↦e2,e2↦−e1\begin{array}{c|c|c} \text{Rotation axis}&\text{Unchanged direction}&\text{Quarter-turn images}\\\hline x&\mathbf{e}_1&\mathbf{e}_2\mapsto\mathbf{e}_3,\quad\mathbf{e}_3\mapsto-\mathbf{e}_2\\ y&\mathbf{e}_2&\mathbf{e}_3\mapsto\mathbf{e}_1,\quad\mathbf{e}_1\mapsto-\mathbf{e}_3\\ z&\mathbf{e}_3&\mathbf{e}_1\mapsto\mathbf{e}_2,\quad\mathbf{e}_2\mapsto-\mathbf{e}_1 \end{array}

Here e1,e2,e3\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3 are the unit vectors along the positive xx-, yy- and zz-axes. Notice the cyclic order x,y,zx,y,z.

[DIAGRAM: asset_name: Positive axis rotation views; asset_slug: positive_axis_views; caption: Looking towards the origin from each positive axis makes a positive quarter-turn anticlockwise; description: Three planar viewing diagrams are labelled viewed from positive x, positive y and positive z towards O. The first has y to the right and z upwards, the second z to the right and x upwards, and the third x to the right and y upwards. A clay anticlockwise quarter-circle arrow in each panel maps the rightward positive direction to the upward positive direction. A note says that the coordinate along the viewing axis is unchanged.]
Looking towards the origin from each positive axis makes a positive quarter-turn anticlockwise

Positive quarter-turn matrices

For rotation through +90∘+90^\circ, with the viewing convention above:

About x:Rx=(10000−1010)About y:Ry=(001010−100)About z:Rz=(0−10100001)\begin{aligned} \text{About }x:\quad\mathbf{R}_x&=\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}\\[2mm] \text{About }y:\quad\mathbf{R}_y&=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}\\[2mm] \text{About }z:\quad\mathbf{R}_z&=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix} \end{aligned}

A −90∘-90^\circ turn reverses both off-diagonal signs. A 180∘180^\circ turn leaves the axis coordinate unchanged and negates the other two. A 270∘270^\circ turn equals a −90∘-90^\circ turn, and a 360∘360^\circ turn is the identity. These rules cover all integer multiples of 90∘90^\circ.

Not in the formula booklet: learn it.

The matrices follow from the three unit-vector images, just as in two dimensions. For an axis rotation you only need to rebuild the two moving columns.

Worked example 5: a positive turn about the x-axis

Question. Find the matrix for rotation through +90∘+90^\circ about the xx-axis, and the image of (2,1,3)(2,1,3).

Plan. Keep xx fixed and rotate (y,z)(y,z) anticlockwise in the view from positive xx.

(x,y,z)↦(x,−z,y)quarter-turn in the yz-planeRx=(10000−1010)unit-vector images as columnsRx(213)=(2−31)apply the rule\begin{aligned} (x,y,z)&\mapsto(x,-z,y)&&\text{quarter-turn in the }yz\text{-plane}\\ \mathbf{R}_x&=\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}&&\text{unit-vector images as columns}\\ \mathbf{R}_x\begin{pmatrix}2\\1\\3\end{pmatrix}&=\begin{pmatrix}2\\-3\\1\end{pmatrix}&&\text{apply the rule} \end{aligned}

Why this step? The pair in the viewing plane is (y,z)(y,z). Applying the ordinary 90∘90^\circ rule to this pair gives (−z,y)(-z,y), while the axis coordinate xx stays unchanged.

Answer. Matrix (10000−1010)\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}; image (2,−3,1)(2,-3,1).

Check. The xx-coordinate stays 22, and squared distance from the xx-axis is y2+z2=10y^2+z^2=10 before and after the turn.

The next example changes the rotation axis to yy, keeping the same positive angle. The viewing-plane coordinates are now (z,x)(z,x), in that order.

Worked example 6: a positive turn about the y-axis

Question. Find the matrix for rotation through +90∘+90^\circ about the yy-axis, and the image of (2,1,3)(2,1,3).

Plan. Keep yy fixed; map the viewing-plane pair (z,x)(z,x) to (−x,z)(-x,z), then put the coordinates back in x,y,zx,y,z order.

z′=−x,x′=z,y′=ypositive turn viewed from +y(x,y,z)↦(z,y,−x)return to the usual orderRy=(001010−100)read the coefficientsRy(213)=(31−2)apply the matrix\begin{aligned} z'&=-x,\qquad x'=z,\qquad y'=y&&\text{positive turn viewed from }+y\\ (x,y,z)&\mapsto(z,y,-x)&&\text{return to the usual order}\\ \mathbf{R}_y&=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}&&\text{read the coefficients}\\ \mathbf{R}_y\begin{pmatrix}2\\1\\3\end{pmatrix}&=\begin{pmatrix}3\\1\\-2\end{pmatrix}&&\text{apply the matrix} \end{aligned}

Why this step? Treating (x,z)(x,z) as the ordinary viewing-plane pair would reverse the direction. From positive yy, use zz to the right and xx upwards.

Answer. Matrix (001010−100)\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}; image (3,1,−2)(3,1,-2).

Check. The positive zz-unit vector maps to the positive xx-unit vector, as required. The yy-coordinate stays 11, and x2+z2=13x^2+z^2=13 is preserved.

For a half-turn about yy, the rule becomes (x,y,z)↦(−x,y,−z)(x,y,z)\mapsto(-x,y,-z), with matrix diag⁡(−1,1,−1)\operatorname{diag}(-1,1,-1). For a negative quarter-turn, reverse the positive quarter-turn arrows. For example, −90∘-90^\circ about zz gives

(x,y,z)↦(y,−x,z),(010−100001)(x,y,z)\mapsto(y,-x,z),\qquad \begin{pmatrix}0&1&0\\-1&0&0\\0&0&1\end{pmatrix}

A +270∘+270^\circ turn about zz has this same matrix. You can therefore find or recognise any permitted angle without memorising a separate matrix for every case.

Watch out

Wrong: describe a three-dimensional rotation only as “90∘90^\circ anticlockwise”. Its axis and viewing direction are missing. Right: give the axis and use a positive or negative angle with the convention of looking towards the origin from the positive side of that axis.

The last question changes the axis once more. Check the unchanged coordinate before considering the other two.

Quick Recap

  • For two successive plane transformations, the first matrix goes on the right: first A\mathbf{A}, then B\mathbf{B}, gives BA\mathbf{B}\mathbf{A}.
  • Describe a combination by stating both transformations fully and in their actual order.
  • In three dimensions, use the three unit-vector images as the columns of the matrix.
  • Reflection in a coordinate plane reverses its perpendicular coordinate; rotation about an axis preserves its axis coordinate.
  • A positive axis rotation is anticlockwise when viewed towards the origin from the positive side of that axis.

Reversing the opening reflection and rotation changes (1,2)(1,2) into (−1,−2)(-1,-2): the order of the transformations matters.