3 Linear Transformations of the Plane

Now that we’re using matrices to represent linear transformations, we’ll find ourselves en- countering a wide range of transformations and matrices; it can become difficult to keep track of which transformations do what. In these notes we’ll develop a tool box of basic transformations which can easily be remembered by their geometric properties.

We’ll focus on linear transformations T : R2 → R2 of the plane to itself, and thus on the 2 × 2 matrices A corresponding to these transformation. Perhaps the most important fact to keep in mind as we determine the matrices corresponding to different transformations is that the first and second columns of A are given by T (e1) and T (e2), respectively, where e1 2 and e2 are the standard unit vectors in R .

3.1 Scaling The first transformation of R2 that we want to consider is that of scaling every vector by some factor k. That is, T (x) = kx for every x ∈ R2. If k = 1, then T does nothing. In this case, T (e1) = e1 and T (e2) = e2, so the columns of the corresponding A are e1 and e2: 1 0 A = . 0 1

We call this the identity matrix (of size 2) and denote it either as I2 or as I when the size is obvious. For any other scale factor k we have k 0 T (e ) = and T (e ) = , 1 0 2 k so the corresponding matrix is given by k 0 A = . 0 k

Now suppose we have two scaling maps: T1 which scales by a factor of k1, and T2 which scales by a factor of k2. Then T2 ◦ T1 is the transformation that scales by a factor of k1 and then by k2, which is to say that it scales by a factor of k2k1. This means that its matrix representation should be given by k k 0  A = 2 1 , 0 k2k1 and indeed we can easily check that       k2 0 k1 0 k2k1 0 A2A1 = = = A. 0 k2 0 k1 0 k2k1 This agrees with our notion of matrix multiplication representing composition of linear trans- formations.

15 Figure 2: Orthogonal projection of v onto w.

3.2 Orthogonal Projection The next linear transformation we’d like to consider is that of projecting vectors onto a line in R2. First we have to consider what it means to project one vector onto another. Take a look at Figure2, where we’re projecting the vector v onto w orthogonally. What we mean

by orthogonal projection is that the displacement vector projw v − v is orthogonal to the vector w, as seen in Figure2.

We can see that projw v will be a multiple of w, so let’s write projw v = kw. Since we require that projw v − v be orthogonal to w, we have

(kw − v) · w = 0.

That is, kw · w − v · w = 0, so v · w k = . w · w This means that we have  v · w  proj v = w. w w · w Now notice that if we project v onto any vector which is a nonzero scalar multiple of w, the

resulting vector will be the same as projw v. So really we’re projecting v onto the line L determined by w. For this reason, we write projL v for the projection of v onto the line L.

Given a line L, we can compute projL v by first selecting a unit vector u = hu1, u2i through which L passes and then projecting v onto u. We then have

 2  e1 · u u1 u1 projL(e1) = proju(e1) = u = u = u · u 1 u1u2

and   e2 · u u2 u1u2 projL(e2) = proju(e2) = u = u = 2 , u · u 1 u2

16 Figure 3: by θ. so the matrix A corresponding to the projection onto L is

 2  u1 u1u2 A = 2 . u1u2 u2 As before, there’s a matrix product that’s worth considering here. If we apply the transfor- mation of projecting onto L twice, this should be no different than applying it once. After the first projection, all the vectors in R2 have been mapped onto L, and projecting a vector on L onto L does nothing. This is borne out by the fact that

 2   2   2  2 u1 u1u2 u1 u1u2 u1 u1u2 A = 2 2 = 2 = A. u1u2 u2 u1u2 u2 u1u2 u2 We can also verify our claim that projecting a vector which already lies on L onto L does nothing:    3 2  2 2    ku1 ku1 + ku1u2 ku1(u1 + u2) ku1 A = 2 3 = 2 2 = , ku2 ku1u2 + ku2 ku2(u1 + u2) ku2 where we using the fact that any vector on L has the form hku1, ku2i for some k.

3.3 Rotation Next we’ll consider rotating the plane through some θ, as depicted in Figure3. Because the vector e1 lies on the unit circle, so does T (e1), and T (e1) makes an angle of θ with the x-axis. As a result, its x- and y-components are cos θ and sin θ, respectively:

cos θ T (e ) = . 1 sin θ

At the same time, since e2 makes an angle of π/2 with e1, the vectors T (e2) and T (e1) should also have an angle of π/2 between them. So the x- and y-components of T (e2) are

17 Figure 4: Reflection across a line. cos(θ + π/2) and sin(θ + π/2), respectively:

cos(θ + π/2) − sin θ T (e ) = = . 2 sin(θ + π/2) cos θ

So the matrix corresponding to rotation by θ is

cos θ − sin θ A = . sin θ cos θ

If we let Aθ and Aα be the matrices corresponding to rotation through an angle θ and an angle α, respectively, then one can compute (using angle-addition identities) that

cos(θ + α) − sin(θ + α) A A = , θ α sin(θ + α) cos(θ + α) which is the matrix corresponding to rotation through the angle θ + α.

3.4 Reflection Next we’ll consider the linear transformation that reflects vectors across a line L that makes an angle θ with the x-axis, as seen in Figure4. Computing T (e1) isn’t that bad: since L makes an angle θ with the x-axis, T (e1) should make an angle θ with L, and thus an angle 2θ with the x-axis. So cos 2θ T (e ) = . 1 sin 2θ

Determining T (e2) is only slightly less straightforward. First, e2 makes an angle of π/2 − θ with L, so T (e2) should make the same angle with L, but on the other side of the line. Since there’s an angle of θ between the x-axis and L, the angle between T (e2) and the x-axis is π/2 − 2θ. (We’re assuming that 0 ≤ θ ≤ π/2, but similar computations can be done for

18 Figure 5: A horizontal shear. other values of θ.) Of course, this angle is in the clockwise direction from the x-axis, so we have cos(−(π/2 − 2θ)) cos(2θ − π/2)  sin 2θ  T (e ) = = = . 2 sin(−(π/2 − 2θ)) sin(2θ − π/2) − cos 2θ Altogether, the matrix for reflecting across L is

cos 2θ sin 2θ  A = . sin 2θ − cos 2θ

Notice that cos 2θ sin 2θ  cos 2θ sin 2θ  A2 = sin 2θ − cos 2θ sin 2θ − cos 2θ  cos2 2θ + sin2 2θ cos 2θ sin 2θ − cos 2θ sin 2θ = = I , cos 2θ sin 2θ − cos 2θ sin 2θ sin2 2θ + cos2 2θ 2 indicative of the fact that reflecting across L twice does nothing.

3.5 Shearing The last linear transformation we’ll consider is that of shearing. Consider Figure5, where we are mapping the standard basis vectors (which are blue) to the orange vectors shown. This is a horizontal shear, where the vector h1, 0i pointing in the x-direction is fixed, but the vector h0, 1i pointing in the y-direction is taken to the vector hk, 1i, where k is some real number. Notice that if k > 0, then our horizontal shear pushes the top of the blue parallelogram to the right, resulting in the orange parallelogram shown. If k < 0, then we push the top of the blue parallelogram to the left. It is easy to see from the definition of this horizontal shear that the corresponding matrix is

1 k A = . 0 1

19 On the other hand, a vertical shear (not shown) would fix h0, 1i and would push the y- component of the vector h1, 0i up k units to the vector h1, ki. So the matrix for a vertical shear is 1 0 A = . k 1

Notice that if we apply a horizontal shear with factor k1 and then another horizontal shear with k2, this is the same as shearing with factor k1 + k2. This is borne out by the fact that 1 k  1 k  1 k + k  2 1 = 1 2 . 0 1 0 1 0 1

In particular, shearing to the left by k is undone by shearing to the right by −k:

1 −k 1 k 1 0 = . 0 1 0 1 0 1

So horizontal shears are invertible. A similar product holds for vertical shears (prove it!). Example 12. (§2.2, Exercise 27 of [1]) Consider the matrices A through E below. 0.6 0.8  3 0  0.36 −0.48 A = , B = , C = 0.8 −0.6 0 3 −0.48 0.64 −0.8 0.6   1 0 D = , E = . −0.6 −0.8 −1 1 Fill in the blanks in the sentences below. We are told that there is a solution in each case. • Matrix represents a scaling. • Matrix represents an orthogonal projection. • Matrix represents a shear. • Matrix represents a reflection. • Matrix represents a rotation.

(Solution) Scaling transformations are scalar multiples of the identity transformations, so their matrices are scalar multiples of I2. So matrix B represents a scaling.

We’ve seen that orthogonal projection matrices have the form

 2  u1 u1u2 2 , u1u2 u2

u  where 1 is a unit vector parallel to the line L onto which we are projecting. The only u2 matrix above that has this form is C, where we have u1 = 0.6 and u2 = −0.8 (or u1 = −0.6 and u2 = 0.8).

20 We know that horizontal and vertical shears have the form 1 k 1 0 and , 0 1 k 1

respectively. The only matrix to have this form is E, which represents a vertical shear down one unit.

Reflections across lines have the form a b  , b −a where a2 + b2 = 1. The matrix A has this form, and represents reflection across a line in the plane.

Finally, the matrix D represents a rotation in the plane through an angle of θ = arccos(−0.8) ≈ 2.4981 rad. ♦

21 References

[1] Otto Bretscher. with Applications. Pearson Education, Inc., Upper Saddle River, New Jersey, 2013.

22