
82 Chapter 2 The Graphics System
an edge. If the original line drawer is used for the shared edge, but the line is drawn
the second time with the endpoints swapped, gaps (undrawn pixels) can occur be-
cause the two sets of drawn pixels cause an effect called cracking. Another way to
avoid cracking is to always draw the line starting with the vertex of the minimum
y-value. This guarantees that the shared edge is drawn in the same order each time.
2.5.2 Circles
The Bresenham line-drawing algorithm has a counterpart for drawing circles using
only integer arithmetic. Let the circle be x
2
+ y
2
= r
2
,wherer is a positive integer.
The algorithm will draw one-eighth ...