COM1370 Summer 2002 -- Midterm Exam

Professor Futrelle, Northeastern U., College of Computer & Information Sciences

AISLE SEAT EXAM

This is a closed-book, closed-notes, no-calculators exam. Exam given, Wednesday, July 31st. Write all answers in your exam book. Do not turn in this question sheet. You should keep it and bring it with you when I go over the exam in class.


1. For the irregular region shown to the right, show the steps in the recursive boundary-fill algorithm until the entire region is filled. You might find it convenient to keep track of the stack, or you could simply rely on your numbering of the stacked pixels to keep the order of the fill straight.   











2. A point P has x,y location 5√2, 5√2 (x and y both 5 x sqrt(2)), so it is a distance 10 from the origin. Using 3x3 transformations in homogeneous coordinates for two dimensions, do the following:

  1. Write out the transformation matrices Trot for a rotation by +π/4 and Ttrans for a translation by Δx = +20.
  2. Apply the matrices to P, first rotating the point and then translating it. (Get the matrix order right!) What is the location of the transformed point P' ? Is this what you expected? (All computations involving √2 can be kept in that form. There is no need to use its numerical value 1.4142135....)
  3. Apply the transformations to the original point P in the opposite order, applying Ttrans first and then Trot. Is this what you expected? (The result should not be as neat.)

3. In the diagram below, a Bézier curve is to be drawn from P1 to P4 using control points P2 and P3 which are both located at 0,8.

Use the cubic Bézier formula for the curve:

Q(t) = (1 - t)3 P1 + 3t(1 - t)2 P2 + 3t2(1 - t) P3 + t3 P4

and apply it to the following figure. In particular, compute the x,y coordinates of the point on the curve at t = 1/2. By symmetry, this point should lie along the line from 0,8 to 8,0. Does it? Describe the convex hull of the four control points. Is the point you computed within this hull?

4. For the curve below, made up of two cubic Bézier curves, draw the control points P2, P3, P'2 and P'3, arranged in such a way that the curve directions at P1 and P'4 are correct and their is no discontinuity in the curve slopes at the meeting point P4, P'1.

5. This question involves only 2x2 matrices, not ones using homogeneous coordinates.

  1. Plot, approximately, the sine and cosine function in the region from -π to +π.
  2. Using the values you demonstrated in (a) write out the rotation matrix, R(π/2) in numerical form.
  3. Assume you are given a line with x,y endpoints 10,0 and 10,5. Compute the values of the endpoints after rotation by the matrix in (b). Draw, approximately, the original line and the rotated line. Is this what you expected?
  4. Write out the rotation matrix R(-π/2). Then show, by matrix multiplication, that the matrix product R(π/2)•R(-π/2) equals the unit matrix.

Return to the COM1370 home page