CS 465 Fall 2006 -- Final exam solution --------------------------------------- Problem 1. 1. Near 10% gray, (c) performs best, then (b), then (a). 2. Near 90% gray, (c) performs best, then (a), then (b). 3. (c) provides the best performance because it has the finest quantization in all cases. However, (b) could be argued to provide a better cost/quality tradeoff because it provides precision sufficient for the human eye while using half the space of (c). Either answer is fine with an appropriate explanation. Problem 2. This function computes the intersection of a ray with a hollow cylinder (one with no end caps) that has radius 1 and length 2. It is centered on the origin and aligned with the z axis. Problem 3. 1. A translation (a) by the vector (1, 1). 2. A reflection (c) across the line y = x (normal is (1, -1)). 3. A nonuniform scale (e) along the direction (1, 1) by a factor of three. You can see that (1, 1) becomes (3, 3) and (1, -1) remains fixed. 4. A translation (a) by the vector (1, 1, 1). 5. A counterclockwise rotation (b) by 120 degrees around the axis (1, 1, 1). You can see this by noting that the matrix cyclically permutes the three coordinates, which leaves the vector (1, 1, 1) fixed. Since three rotations will bring you back to the identity, the rotation is by 120 degrees. 6. A nonuniform scale (e) along the direction (1, 1, 1) by a factor of 4. You can see that (1, 1, 1) becomes (4, 4, 4). Something orthogonal to (1, 1, 1) will be preserved -- for instance (1, 2, -3). Problem 4. To find the bounding box, we must find the minima and maxima of the coordinate functions. They are x (t) = 5 t^3 - 6 t^2 + 1 x'(t) = 15 t^2 - 12 t y (t) = - 3 t^2 + 3 t y'(t) = - 6 t + 3 x' is zero at t = 0 and t = 4/5. y' is zero at t = 1/2. The minimum x occurs at t = 4/5, where x(5/4) = 5 4^3 / 5^3 - 6 4^2 / 5^2 + 1 = (4^3 - 6 4^2 + 5^2) / 5^2 = (64 + 25 - 96) / 25 = -7 / 25 = -0.28 The maximum y occurs at t = 1/2, where y(1/2) = - 3/4 + 3/2 = 3/4 The maximum x and minimum y are achieved at the endpoints. So the bounding box is [-0.28, 1] x [0, 3/4] Problem 5. You can find which items go in each list by a linear search. But then getting the order right requires understanding the pointers. 1. 1, 4 2. D, E 3. c, b, e 4. 1, 4, 2 5. e, b, d, h 6. A, C, F, D Problem 6. 1. Saturation is increased for blue and red. (a narrower spectrum is more saturated) 2. Hue is changed for blue only. (a change in center wavelength changes the hue) 3. B is the better choice because the increased saturation will give you a wider color gamut.