Page 51 - DCAP504_Computer Graphics
P. 51
Computer Graphics
The following figure 4.3 depicts eight-way symmetry of a circle.
Figure 4.3: Eight-way Symmetry of a Circle
Equation of a circle with (0, 0) as its centre is given by:
Fcircle (X, Y) = X2 + Y2 – R2
Checking the sign of the circle function determines the relative position of any point (X, Y), that is,
Fcircle (X, Y)< 0, if (X, Y) is inside the circle boundary
Fcircle (X, Y)= 0, if (X, Y) is on circle boundary
Fcircle (X, Y)> 0, if (X, Y) is outside the circle boundary
Figure 4.4: Equation of a Circle
In figure 4.4, the pixels are plotted at (X k, Y k), next we need to determine whether the pixel at position
(X k+1, Y k) or one at position (X k+1, Y k-+1) or at position ((X k, Y k-1) is closer to the circle.
Firstly, let us check if the diagonal point is inside or outside the circle, i.e.
= (X k+1)2 + (Y k-+1)2 – R2 is < 0, = 0, or > 0
44 LOVELY PROFESSIONAL UNIVERSITY