Professional Documents
Culture Documents
Bre Circle
Bre Circle
One pixel which is outside (A), and the other pixel which is inside (B) the circle boundary,
and
Derivation
(xk +1 , yk-1 / 2)
Let us define this equation as the decision parameter, using the mid-point M P:
Pk+1- Pk = ( xk+1+1 )2 + ( yk+1-1 / 2 )2- r2 - [ (xk+1)2 + ( yk-1 /2 )2 - r2]
= (xk+1 + 1)2 + (yk+1-1 / 2)2 - r2 - [ (xk+1)2 + (yk-1 / 2)2 - r2 ]
= (xk+1 + 1)2 - (xk+1)2 + ( yk+1-1 / 2 )2- ( yk-1 / 2 )2
Pk+1= Pk + 2xk +3 + (yk+1)2 – yk+1- (yk)2 + yk
If Pk < 0: yk+1 = yk (choose point A)
Let us calculate the initial decision parameter (P0) where the initial points will be defined as (0, r) [which is the first point to be
plotted of the first octant].
If r is an integer:
P0 = 1 - r
If r is a floating point:
P0 = 5/4 - r
Step 2: Declare x, y, r, xc , yc , P as variables, where (xc , yc) are coordinates of the center.
Step 3: Put x = 0 and y = r
Set P = P + 2x + 3
else if (P >= 0):
Set P = P + 2(x-y) + 5
y = y - 1
Step 7: Do x = x + 1
Step 8: End
Formulas used:
For Pk < 0 :
Pk+1=Pk+ 2xk+3
For Pk ≥ 0 :
Pk + 2xk+2yk+5