Transformations, Matrices, and Computer Animation

Total Page:16

File Type:pdf, Size:1020Kb

Transformations, Matrices, and Computer Animation

Transformations, Matrices, and Computer Animation

In previous investigations you used coordinates to represent and apply transformations. The coordinate models provided ways to describe transformations numerically and algebraically. Now you will investigate how matrices can be used to represent transformations and produce computer animations.

LAUNCH

Shown above are sample displays from a simple animation that runs on a graphics calculator. Run this animation, or another animation, or examine the displays above.

(a). Describe all the different motions of the flag or the other animation you run. (b). How do you think this animation is done? (c). Describe some examples of computer animations that you have seen in the world around you.

Matrices and Transformations Page 65 EXPLORE: Rotation Matrices

In previous investigations you studied coordinate models of transformations of the plane, including line reflections, translations, and rotations. These transformations can be used to make a shape appear to move on a graphics screen.

1. In the animation above the flag moves above and below a horizontal line. Think about how the flag could be transformed from a straight up position to a straight down position, as shown in the figure below. In this figure the flag pole begins at A, which is at the origin. ABCD GEF (a). In your group, discuss at least two ways to transform the up-flag into the down- flag using one or more transformations.

(b). Did you, or could you, transform the up-flag into the down-flag by using a 180° rotation? • Which of the labeled points is the center of such a rotation?

• Which point is the image of point B?

• What is the pre-image of segment GE?

Matrices and Transformations Page 66 (c). Find the coordinates of the images of the following points under a 180˚ rotation about the origin. Note that some of the points are on the flag and some are not. What is the general coordinate rule? (In the figure at the right A should be lower, placed at the origin, and the x-axis should be slightly raised.)

Coordinates of C Original Point Image Point D B B G (5, 2) A (9, 8) (5, 0) E (a, b) GF

2. Using the general coordinate rule for a 180˚ rotation about the origin and matrix multiplication, you can find a matrix that represents the rotation. First, you will need to

Matrices and Transformations Page 67 represent points as one-column matrices. So, (x, y) looks like

Matrices and Transformations йPage 68 x щ лкy ыъ Matrices and Transformations йPage 69 x щ лкy ыъ and its image under a 180˚ rotation, (-x, -y), looks like

Matrices and Transformations Page 70 Matrices and Transformations й-Page 71 x щ лк- y ыъ .

(a). Recall that matrices may be multiplied when the number of columns in the first matrix equals the number of rows in the second. Consider the following matrix multiplication. Determine the entries of the 2 2 matrix, so that the multiplication “works.”

(b). Compare your answer for part (a) with that of other groups. Resolve any differences.

(c). The matrix you found in part (a) is a representation of a 180˚ rotation about the origin. When you multiply any point by that matrix you get its image under the rotation. Multiply the matrix by the rest of the “Original Points” in the table in Problem 1 and compare to the “Image Points.” Be sure to represent the points as one-column matrices and multiply with the point on the right of the transformation matrix.

3. In a similar way you can build a matrix representation of a 90˚ counterclockwise rotation centered at the origin.

(a). By thinking about the actual rotation, find the image of (2, 0) under a 90˚ counterclockwise rotation centered at the origin. Draw a set of coordinate axes and plot the point and its image. Do the same for the points (2, 3) and (8, -5).

Matrices and Transformations Page 72 (b). The coordinate rule for a 90˚ counterclockwise rotation is: (x, y)  (__ , __).

(c). Build a matrix representation for this 90˚ rotation like you did before, by determining the entries of the 2  2 matrix below.

Matrices and Transformations Page 73 (d). Now you have a matrix that models a 90° counterclockwise rotation about the origin. Multiply the matrix by the one-column matrices for the points (2, 3) and (8, -5). Check to see that you get the same answers as in part (a).

(e). One advantage of a matrix representation of a transformation is that you can

Matrices and Transformations Page 74 use it to quickly transform an entire polygon. Consider ∆ ABC =

Matrices and Transformations йPage 75 2 6 4 щ к ъ л2 0 -3 ы Matrices and Transformations йPage 76 2 6 4 щ к ъ л2 0 -3 ы . • Sketch this triangle in a coordinate plane.

• Multiply the matrix representation of ∆ ABC by the 90 ˚ transformation matrix to find the image of ∆ ABC under a 90° counterclockwise rotation centered at the origin. When multiplying the two matrices, the matrix representation of ∆ ABC should be on the right of the rotation matrix.

• Sketch the image triangle, ∆ ABC.

Matrices and Transformations Page 77 4. So far you have found matrices that represent 90˚ counterclockwise and 180 ˚ rotations about the origin. The matrix below represents another transformation.

Matrices and Transformations Page 78 Matrices and Transformations Page 79 0 .707 -0.707 A = й щ к ъ л0 .707 0.707 ы (a). To investigate the effect of this transformation: • Represent the flag shown below with a 2  4 matrix. (Assume that the pole of the flag begins at the origin.)

• Multiply the flag’s matrix by the given transformation matrix on its left.

• Sketch the flag and its image in a coordinate plane.

(b). Describe as completely as you can the motion that is represented by the matrix. Compare your description to that of other groups. Discuss, and resolve any differences.

Matrices and Transformations Page 80 (c). Now consider a vertical flag pole with no banner that is 10 units long. Place the flag pole so that it begins at the origin. Using your description of the motion in part (b), sketch the image of the vertical flag pole. Check your image by representing the vertical flag pole as a matrix and using matrix multiplication to find the image.

(d). Do as in Part (c), but choose your vertical flag pole to begin somewhere other than the origin. Discuss the results.

Matrices and Transformations Page 81 5. The FLAG SPIN program below can be used to rotate a flag about the origin using steps of 45˚ .

FLAG SPIN Program Comments For(N,1,8,1) Beginning of loop. Transforms the shape in 8 steps. ClrDraw Clears all drawings. Stores the product of the transformation [A][B] [B] matrix A and matrix B in matrix B.

Line ([B](1,1),[B](2,1),[B](1,2), [B](2,2)) Draws a line segment from the point whose coordinates are in the 1st column of the shape matrix B to the point whose coordinates are in the 2nd column.

Line ([B](1,2),[B](2,2),[B](1,3), [B](2,3)) Draws a line segment from the point whose coordinates are in the 2nd column of B to the point whose coordinates are in the 3rd column of B.

Line ([B](1,3),[B](2,3),[B](1,4), [B](2,4)) Draws a line segment from 3rd column point to 4th column point. For(K,1,25,1) Beginning of pause loop.

End End of pause loop. End End of loop (N, 1, 8, 1). Stop End of program.

(a). Build a matrix that represents the up-flag in Problem 1 with the vertices for point A in the 1st column, the vertices for C in the 2nd column, the vertices for D in the 3rd column, and B in the 4th column. Enter this matrix in your calculator as matrix B.

(b). Why must the points be entered in the order A, C, D, B?

Matrices and Transformations Page 82 (c). Write down a matrix that represents a 45˚ counterclockwise rotation with center at the origin. Enter this matrix in your calculator as matrix A.

(d). Describe the geometric effect of the statement [A][B]  [B].

(e). Describe the effect of the three Line commands in the FLAG SPIN program.

(f). Explain why the ClrDraw command is needed to accomplish this animation.

(g). Load and run the FLAG SPIN program. Be sure first to turn off all STAT PLOTs and Y= plots, set the MODE to Degree, and set your viewing window. Debug as necessary and discuss.

SUMMARIZE

(a). Use the coordinate representation of a 90˚ clockwise rotation about the origin to find the matrix representation for that rotation. Explain how you did it.

(b). Describe how to use the FLAG SPIN program to rotate the flag clockwise about the origin using steps of 90˚ .

(c). Describe how matrices can be used to create an animation of a flag spinning around the origin.

Be prepared to share your group’s matrix and descriptions with the class.

Matrices and Transformations Page 83 CHECK FOR UNDERSTANDING

Matrices and Transformations Page 84 (a). Build a matrix that represents a 270˚ counterclockwise rotation about the origin.

(b). Use the matrix to find the image of the point (-2, 5) and the image of the triangle ∆ HJK = Matrices and Transformations й-1Page 85 4 3 щ к ъ л 2 -3 5 ы Matrices and Transformations Page 86

Recommended publications