Tips for Assignment 6


The variable "spacing" is the distance from the center of one dot to the center of the next (and therefore the distance from one upper-left corner to the next).

The grid is always as small as it can be and still hold a given triangle. If your triangle is big (100 dots on an edge), the dots will be quite small. If the triangle is extremely big (> 450) the grid won't draw itself. To see this bit of code in action, look in the Grid constructors. If n>450, the boolean "draw" is set to false. Drawing a 450*450 grid would be pointless, as the dots would be very small and the machine would have a difficult time redrawing the dots. Some slower macs might even crash.

Good test values for the triangle are (0,10) (10,0) and (10,10) and things around there. But you can still run tests on very large triangles, you just won't get a picture.

The fields needed to calculate inside() are x1,y1,x2,y2,x3,y3. Those are the only fields you need to use. They are the x and y values of each vertice of the triangle.


Last update:  06/08/00 11:55