This geometric point of view is obviously useful when we want to model
the motion or changes in shape of an object moving in the plane or in 3-space.
However, it is useful in higher dimensions as well. The idea that
any matrix can be thought of as the product of simpler matrices that correspond
to higher dimensional versions of rotation, reflection, projection, shearing,
dilation and contraction is of enormous importance to both pure and applied
mathematicians.
(1,2), (3,3), (4,4) and (2,3)then the linear transformation T(x,y) = (x - y, x + y) will transform it to a parallelogram with vertices at
(-1,3), (0,6), (0,8) and (-1,5)The mathematical justification for this is quite simple. Skipping a few details, since any parallelogram in the plane can be described simply in terms of vector sums and scalar multiples and since linear transformations "preserve" vector sums and scalar multiples, the image of the parallelogram must be a new parallelogram (or a line segment or a point).
Exercise 1: In general a parallelogram in the plane can be described using vectors. The collection of all points of the form
{ p + au + bv | 0 < a < 1 and 0 < b < 1 }
(where p, u and v are vectors and a and
b
are scalars) will be a parallelogram with vertices at the points
p,
p
+ u, p + u + v, and p + v. Find
p,
u
and v for the parallelogram
P with vertices at (1,2), (3,3),
(4,4), (2,3) -- note that there are four ways to do this.
If T is a linear transformation defined by
T(x) = Ax,
where A is a 2 x 2 matrix, then show that the image T(P)
is also
a parallelogram by finding its vector description. Show that the
vertices of the transformed parallelogram are found by transforming the
vertices of the original parallelogram P.
A common use of plot is to take a list of data points and graph them, connecting them with straight line segments. For example,
>> plot( [ 1, 3, 4, 2, 1 ], [ 2, 3, 4, 3, 2 ] )pairs up each number in the first list with the corresponding number in the second list to get the data points (1,2), (3,3), (4,4), (2,3) and (1,2) again. The command above will thus produce a graph of the parallelogram P with these points as vertices. We can adjust the axes so that the parallelogram does not fill the entire plot window with a command like
>> axis( [ -8, 8, -8, 8 ])And the command below forces MATLAB to use the same scale on the vertical and horizontal axes.
>> axis equalConsider the linear map defined by (u,v) = (x - y, x + y). Next we want to make a plot that will contain one copy of the plane using the usual x and y coordinate and another copy of the plane where we will call the horizontal coordinate u and the vertical coordinate v. In the xy-plane we will draw the parallelogram P and in the uv-plane we will draw its transformation under the given linear map.
>> x = [ 1, 3, 4, 2, 1 ]
>> y = [ 2, 3, 4, 3, 2 ]
>> u = x - y
>> v = x + yNext we build the plots:
>> subplot(1,2,1), plot(x,y), xlabel('x'), ylabel('y'), axis([-8,8,-8,8]),... axis equal, title('The original parallelogram')
>> subplot(1,2,2), plot(u,v), xlabel('u'), ylabel('v'), axis([-8,8,-8,8]),... axis equal, title('The transformed parallelogram')Since we want an array of plots with one row and two columns we start with subplot(1,2,..). When we are ready to give the details of the first plot we use subplot(1,2,1) and for the second plot we use subplot(1,2,2). In the first plot the horizontal axis is labeled x, the vertical axis is labeled y and the whole plot is in a window where x runs from -8 to 8 and so does y. There are further details to specify but we are out of room on this line. The three dots at the end allow us to continue the command on the next line. We force MATLAB to use the same scale on the vertical and horizontal axes and we give the plot a descriptive title. The second plot is very similar.
The geometric effect of the transformation (u,v) = (x + y, x - y) is clearer if we look at how the unit square transforms. It also helps to look at what happens when we apply the same transformation repeatedly. To make this easier we will use matrices. We begin as before by setting up a vectors x and y that correspond to the vertices of the unit square:
>> x = [ 0, 1, 1, 0, 0 ] % S has vertices at (0,0), (1,0), (1,1) and (0,1)
>> y = [ 0, 0, 1, 1, 0 ] % we list them in the order we want to connect themNow instead of simply working with x and y as we did above, it is easier in the long run if we make a matrix S whose columns contain the vertices of the square. In other words, our vector x will be the first row of S and the vector y will be the second row:
>> S = [x;y]
>> plot(S(1,:), S(2,:)) % has the same effect as plot(x,y)
>> axis equal, axis([-2,2,-2,2])Since the vertices of the square are now listed as the columns of the matrix S, we can easily transform them. We just define the coefficient matrix for our transformation, in this case:
>> A = [ 1 -1; 1 1] % sends a vector (x,y) to (x-y,x+y)and then multiply:
>> T1 = A*S
>> plot(S(1,:), S(2,:), T1(1,:), T1(2,:)), ...
axis equal, axis([-2,2,-2,2]) % to plot the square with its transformWe can then transform further if we wish:
>> T2 = A*T1
>> plot(S(1,:), S(2,:), T1(1,:), T1(2,:), T2(1,:), T2(2,:)),...
axis equal, axis([-3,3,-3,3])
>> t = 0:0.1:6.3;
>> x = cos(t);
>> y = sin(t);
>> D = [x;y];
>> A = [1 -1; 1 1];
>> T1 = A*D;
>> plot( D(1,:), D(2,:), T1(1,:), T1(2,:) ), ...
axis equal, axis([-2,2,-2,2])
NOTE: Be sure to use the plotting option axis
equal in the exercises below. This ensures that your disks
will be round, not elliptical. Typically, the transformed disk will
be elliptical and you want to get a true picture of how the disk changed
under the linear transformation.
Exercise 2: Let S be the unit square and let T be the transformation T(x,y) = (x - y, x + y) as discussed in the examples above. Plot S, T(S), T(T(S)), and T(T(T(S))) together on the same coordinate axes. Label each figure and summarize your results - that is, explain the geometric effect of the transformation T as clearly as you can.
Exercise 3: Consider the linear transformation defined by T(x,y) = (0.8x, 1.4y). What is the geometric effect of this transformation? Plot the disk D together with its transform T(D). Also include the figure you get by applying T to D five times. Label each of the three figures by hand or using the menu bars in your MATLAB plot window to add text to your plot. Again, be sure to use the axis equal option so that disks look like disks, not ellipses. What will the limit figure look like if we continue transforming by T forever?
Exercise 4: Consider the linear transformation defined by T(x,y) = (2x+y, x +y).
R = [ cos(15 degrees) - sin(15 degrees) ]
[ sin(15 degrees) cos(15 degrees) ]Don't forget that the cosine and sine functions in MATLAB are set up under the assumption that you work in radians.
Exercise 8: Consider the basic shearing transformation (x,y) -> (x + y, y). As we discussed in class, this is a shear parallel to the horizontal axis. What happens if we consider the following sequence of transformations? If we first rotate by 45 degrees the horizontal axis moves into the line y = x. Then apply the shear (x,y) -> (x+y,y). Finally, rotate in the opposite direction by 45 degrees. What is the combined geometric effect and what is the matrix of the resulting transformation?
Exercise 9: A translation is a particularly simple
kind of transformation -- for example, a map of the form (x,y) -> (x
+ 2, y -3) takes any figure and slides it right by 2 and
down by 3. This is not a linear transformation since it cannot
be expressed as a matrix A times the vector (x,y).
We can use a simple trick called homogeneous coordinates to get
around this difficulty if we want to combine translations with rotations
or other linear transformations. We simply use (x,y,1) instead of
(x,y) to talk about points in the plane. With this change of coordinate
system, the translation above becomes (x,y,1) maps to (x + 2, y + 3, 1)
and this we can describe this using matrix multiplication:
[ 1 0 2 ] [ x ] [ x + 2 ]
[ 0 1 3 ] * [ y ] = [ y + 3 ]
[ 0 0 1 ] [ 1 ] [ 1 ]Rotation through an angle t can easily be translated into these coordinates as well:
[ cos t -sin t 0 ] [ x ] [ x*cos t - y*sin t ]
[ sin t cos t 0 ] * [ y ] = [ x*sin t + y*cos t ]
[ 0 0 1 ] [ 1 ] [ 1 ]Multiplying these 3 x 3 matrices corresponds to composing these transformations on the plane. Find the matrix for reflection across the line y = x followed by translation by the vector (3,4).