0% found this document useful (0 votes)
551 views5 pages

Bresenham's Circle Algorithm

Bresenham's circle algorithm is used to draw digital circles by determining which pixel points lie closest to the actual circle. It defines decision parameters to determine if the next pixel should be above or below the current y value. The algorithm initializes values and calculates the decision parameter at each step to plot points along the circle perimeter until the x value exceeds y, at which point it stops. An example demonstrates plotting points for a circle with radius 10. Exercises are provided to apply the algorithm for different circle parameters.

Uploaded by

parth1806
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
551 views5 pages

Bresenham's Circle Algorithm

Bresenham's circle algorithm is used to draw digital circles by determining which pixel points lie closest to the actual circle. It defines decision parameters to determine if the next pixel should be above or below the current y value. The algorithm initializes values and calculates the decision parameter at each step to plot points along the circle perimeter until the x value exceeds y, at which point it stops. An example demonstrates plotting points for a circle with radius 10. Exercises are provided to apply the algorithm for different circle parameters.

Uploaded by

parth1806
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Bresenham’s Circle Algorithm

Define: D(si) = distance of p3 from circle


D(ti) = distance of p2 from circle

i.e. D(si) = (xi + 1)2 + yi2 – r2 [always +ve]


D(ti) = (xi + 1)2 + (yi – 1)2 – r2 [always -ve]

• Decision Parameter pi = D(si) + D(ti)


so if pi < 0 then the circle is closer to p3 (point above)
if pi ≥ 0 then the circle is closer to p2 (point below)

1
The Algorithm
x0 = 0
y0 = r
p0 = [12 + r2 – r2] + [12 + (r-1)2 – r2] = 3 – 2r

if pi < 0 then
yi+1 = yi
pi+1 = pi + 4xi + 6
xi+1 = xi + 1
else if pi ≥ 0 then
yi+1 = yi – 1
pi+1 = pi + 4(xi – yi) + 10

• Stop when xi ≥ yi and determine symmetry


points in the other octants 2
Example
r = 10
p0 = 3 – 2r = -17
Initial point (x0, y0) = (0, 10)
10    

i pi xi, yi 9  
0 -17 (0, 10) 8 
7 
1 -11 (1, 10)
6 
2 -1 (2, 10)
5 
3 13 (3, 10) 4 
4 -5 (4, 9) 3 
5 15 (5, 9) 2 
1 
6 9 (6, 8)
0 
7 (7,7)
0 1 2 3 4 5 6 7 8 9 10
3
p0 = -17+ 4*0 + 6 = -11

p1 = -11+ 4*1 + 6 = -1

p2 = -1+ 4*2 + 6 = 13

p3 = 13 + 4(3 – 10) + 10 = -5
Exercises
• Draw the circle with r = 12 using the
Bresenham algorithm.

• Draw the circle with r = 14 and center at (15,


10).

You might also like