![]() |
We modeled an improved drawUnfilledCircle algorithm from Bresenham's algorithm in
the book. Taking advantage of the fact that circles are symmetric such that each
octent is identical, we drew only one octent, and reflected it around to the rest
of the circle. In order to correct for the screen coordinates, we reflected our
our points about the center-based coordinates to the third quadrant, then reflected
it from there about the corner-based coordinates to the other quadrants. Basically,
this ammounted to subtracting one from some values and not others. For the ellipses, we did nearly the same thing, fixing the code from the book. Because an ellipse is only symmetric about a quadrant, we weren't able to make the code any faster. The circle and ellipse drawing functions are in Circle.c and Ellipse.c respectively, and they can be included with Circle.h, and Ellipse.h. As an extension, we implemented filled circles and ellipses as well. |

