Bresenham S Circle Generating Algorithm
Bresenham S Circle Generating Algorithm
Computer
Science Hub
Bresenham’s
Circle
Generating
Algorithm
Basics
Decision parameter
Algorithm
Plot8points?
Example
Draw a circle with center=(0,0) and radius=3
• Xc=0 ,Yc=0 , r=3
• Assign X=0, y=r→y=3
• Initial value of p=3-2r →3-2*3 =-3 p=-3
X Y P Coordinates Calculations
0 3 -3 (0,3),(3,0),(0,-3),(-3,0) P<0→p=p+4x+6→-3+4*0+6= 3,x=x+1→1
1 3 3 (1,3),(3,1),(1,-3),(3,-1),(-1,3),(-3,1),(-3,-1),(-1,-3) P>0→p=p+4(x-y)+10→3+4(1-3)+10=5,y=y-1→2
X=x+1→2
2 2 5 (2,2),(2,-2),(-2,2),(-2,-2) Endpoint reached.x=y
4 Y-Values
3
0
-4 -3 -2 -1 0 1 2 3 4
-1
-2
-3
-4