Computer Science I

MC140.01 / MC140.02

Fall 2000

Hints for Assignment 3

due Wednesday 4 October 2000, 12noon

When working with computer graphics, there are typically three coordinate systems defined:

With this assignment, you can think of plotting the shapes (rectangle, triangle and circle) on a piece of graph paper. Your grid data structure is that piece of graph paper. It has dimensions MAX by MAX. The squares on your grid can be numbered in two ways:

You can translate between the two coordinate systems using these formulae: You "mark" points in the grid by setting the characters in the grid, as follows: Note that in C, arrays are stored in row-major order, which means that Y comes before X.