| EXERCISES FOR WEEK
3 |
| week3-1 | Suppose your real world window frame is given by Frame.Left, Frame.Right, Frame.Bottom, and Frame.Top and the values for
width and height of the screen window are given by ScreenWindow.Width and ScreenWindow.Height.
If the default viewport is used (the frame is mapped to the entire window),
what is the real value (in terms of the real frame setting) for
the pixel values (x,y) returned by the mouse click. In other words,
to what point in your real window on your graph paper does the mouse
click correspond?
|
|||||||||||||||||||||||||||||||||||||
| week3-2 | Test your answer to exercise 1 with this case:
|
|||||||||||||||||||||||||||||||||||||
| week3-3 | Regarding exercise 2, what will be the coordinates of the viewport within the screen window if we choose a viewport that preserves the aspect ratio of the real frame and is centered within the screen window? Test your answer to exercise 3 by choosing this viewport with the window and mouse info given in the test case in exercise 2.
|
|||||||||||||||||||||||||||||||||||||
| week3-4 | Do practice exercise 3.3.1 on page 109 of the Hill textbook (Line Clipping Algorithm). Check your solutions in the back of the book.
|
|||||||||||||||||||||||||||||||||||||
| week3-5 | See Hill, top of page 120. Show that the parametric representation of a parabola, given by is consistent with the implicit form given by: y2 - 4ax = 0 | |||||||||||||||||||||||||||||||||||||
| week3-6 |
| |||||||||||||||||||||||||||||||||||||
| week3-7 |
| |||||||||||||||||||||||||||||||||||||
| week3-8 |
| |||||||||||||||||||||||||||||||||||||
| week3-9 | Write a program to draw the parametric Rose Curve, given by the function f(Ø) = K cos (nØ), where n specifies the number of petals in the rose. Try it out for several different values. If you get really ambitious, this could be a menu option. What are the beginning and ending values for Ø? | |||||||||||||||||||||||||||||||||||||
| week3-10 |
|