The key feature of circle that it is highly symmetric. So, for whole 360 degree of circle we will divide it in 8-parts each octant of 45 degree. In order to that we will use Bresenham’s Circle Algorithm for calculation of the locations of the pixels in the first octant of 45 degrees. It assumes that the circle is centered on the origin. So for every pixel (x, y) it calculates, we draw a pixel in each of the 8 octants of the circle as shown below:
Algorithm:
Step 1: Read the radius of circle (r).
Step 2: Set decision parameter d = 3 – 2r.
Step 3: x=0 and y=r.
Step 4: do
{
Plot (x,y)
If(d<0) then
{
d = d + 4x + 6
}
Else
{
d=d + 4(x-y) + 10
y=y-1
}
X=x-1
}
While(x<y)
Step 5: stop
Plotting 8 points, each point in one octant
Call Putpixel (X + h, Y + k).
Call Putpixel (-X + h, Y + k).
Call Putpixel (X + h, -Y + k).
Call Putpixel (-X + h, -Y + k).
Call Putpixel (Y + h, X + k).
Call Putpixel (-Y + h, X + k).
Call Putpixel (Y + h, -X - k).
Call Putpixel (-Y + h,-X + k).