This OSSLET is used in the first course of our four semester core mathematics sequence. The course has a three week block of instruction on matrix operations and solutions to systems of equations that culminates with two 55 minute lessons: Image Transformations I (Manipulating Still Images) and Image Transformations II (Animations).
The system of equations used in this exercise is written in matrix vector notation:
Students use the imageAnimations OSSLET to see a visual effect. Then they must find a matrix A and a vector \vec b that will produce this effect. Finally, they use the OSSLET to check their work.
Open the OSSLET with an extra twist. We have marked three points in the original image, the points located at (0, 0) (marked by a red square), (1, 0) (marked by a green square), and (0, 1) (marked by a blue square). Try the various animations to see what happens to these three points during the animations.
Notice that
A\left[{\begin{array}{c}0 \\ 0 \\ \end{array}}\right] + \vec b = \vec b
so that the vector \vec b determines what happens to the point (0, 0) (marked by a red square).
In particular if \vec b = (0, 0) then the point (1, 0) is placed at the location on the screen given by the first column of the matrix A and the point (0, 1) is placed at the location on the screen given by the second column of the matrix A.
It is often helpful to think of the transformation \vec y = A \vec x + \vec b as having two steps:
The first step takes the vector \vec x to the location A \vec x. This first part leaves the point (0, 0) fixed but may manipulate the image around that point -- for example, magnifying or reducing the image, stretching or shrinking the image, or rotating it.
Then the second step -- adding the vector \vec b -- translates this new image by sliding it left or right and up or down.
Notice that if the matrix A is the identity matrix then
A \vec x + \vec b = I \vec x + \vec b = \vec x + \vec b \quad \quad {\rm or} \quad \quad
A \vec x + \vec b =
\left[{\begin{array}{cc}1 & 0 \\ 0 & 1 \\ \end{array}}\right] \left[{\begin{array}{c} x_1 \\ x_2 \\ \end{array}}\right] +
\left[{\begin{array}{c} b_1 \\ b_2 \end{array}}\right] = \left[{\begin{array}{c} x_1 + b_1 \\ x_2 + b_2 \\ \end{array}}\right]
and we have a pure translation with the original image sliding left or right by b_1 and up or down by
b_2
Manipulating Still Images
Day one of this two-day lesson concentrates on placing a still image at a location on the screen by applying one of the following techniques: Scale the image to a different size; translate or shift the image; skew the image; reflect; and rotate the image about an axis. Most students will be able to discover how to accomplish most of these transformations.
Since we are manipulating still images rather than creating animations, the time parameter t does not appear in either the matrix A or the vector \vec b.
To scale an image by a factor of r while keeping the point (0, 0) fixed we use
A = \left[{\begin{array}{cc} r & 0 \\ 0 & r \\ \end{array}}\right] \quad
\vec b = \left[{\begin{array}{c}0 \\ 0 \\ \end{array}}\right]
We can scale by different factors horizontally and vertically by using
A = \left[{\begin{array}{cc} r & 0 \\ 0 &s \\ \end{array}}\right] \quad
\vec b = \left[{\begin{array}{c}0 \\ 0 \\ \end{array}}\right]
To reflect an image in a line that makes an angle \theta measured counterclockwise from the x-axis we can first rotate clockwise by an angle \theta, then reflect in the x-axis, and then rotate counterclockwise by the angle \theta. Thus, we use
The difference between an animation and simply manipulating a still image is time. For an animation the location on the screen of each point in the original image depends on time. Thus, the entries in the matrix A and the vector \vec b depend on the time parameter t. The OSSLET is designed so that this parameter starts at t = 0 and goes up to t = 1. As an example, consider the Jump Challenge in the OSSLET we have been using on this page. In that window click the Jump Challenge button and then the Play button. Notice the Black Knight jumps straight up with no scaling, rotation, or skewing. The matrix A is the identity matrix and the vector \vec b is responsible for the action we see. In this example,
\vec b = \left[{\begin{array}{c}b_1 \\ b_2 \\ \end{array}}\right] =
\left[{\begin{array}{c} 0 \\ 12 t (1 - t)\\ \end{array}}\right]
Just as with transformations of still images, it is often helpful to think of an animation as having two components:
The first component leaves the point (0, 0) fixed but may animate the image around that point -- for example, magnifying or reducing the image, stretching or shrinking the image, or rotating it.
Then the second step -- adding the vector \vec b (which depends on t) -- moves the point (0, 0) along a path. In the Jump Challenge example, the center of the Black Knight (that is, the point (0, 0) in the original image) traces out the path:
\vec b(t) = (0, 12t(1 - t))
Notice that because the x-coordinate of \vec b(t) is zero the path traced by the point (0, 0) just moves up and down with no left or right motion. When t = 0 or t = 1 we see that \vec b is just (0, 0) and the Black Knight is in the center of the screen. When t = 0.5 the Black Knight is 3 units above the center of the screen.
The Spinning in Place Challenge in the OSSLET is an example of an animation with \vec b(t) = 0 so that the Black Knight remains in the center of the screen but in this case as the time t goes from zero to one he rotates counterclockwise through two complete rotations. This animation is produced by