Embed presentation
Download to read offline
![www.eazynotes.com Gursharan Singh Tatla Page No. 1
BRESENHAM’S CIRCLE ALGORITHM
Bresenham Circle ( Xc, Yc, R):
Description: Here Xc and Yc denote the x – coordinate and y – coordinate of the center of the
circle. R is the radius.
1. Set X = 0 and Y = R
2. Set D = 3 – 2R
3. Repeat While (X < Y)
4. Call Draw Circle(Xc, Yc, X, Y)
5. Set X = X + 1
6. If (D < 0) Then
7. D = D + 4X + 6
8. Else
9. Set Y = Y – 1
10. D = D + 4(X – Y) + 10
[End of If]
11. Call Draw Circle(Xc, Yc, X, Y)
[End of While]
12. Exit
Draw Circle (Xc, Yc, X, Y):
1. Call PutPixel(Xc + X, Yc, + Y)
2. Call PutPixel(Xc - X, Yc, + Y)
3. Call PutPixel(Xc + X, Yc, - Y)
4. Call PutPixel(Xc - X, Yc, - Y)
5. Call PutPixel(Xc + Y, Yc, + X)
6. Call PutPixel(Xc - Y, Yc, + X)
7. Call PutPixel(Xc + Y, Yc, - X)
8. Call PutPixel(Xc - Y, Yc, - X)
9. Exit](https://image.slidesharecdn.com/bresenham-circle-algorithm-130403033442-phpapp01/85/Bresenham-circle-algorithm-1-320.jpg)
The document describes Bresenham's circle algorithm for drawing circles on a pixel-based display. It provides pseudocode that uses the circle's center coordinates (Xc, Yc) and radius R to iteratively call a Draw Circle function, which plots the 8 pixels surrounding each incremental (X,Y) coordinate along the circle boundary until the endpoint is reached. The algorithm uses incremental decision variables and conditional branching to efficiently plot circular pixels without calculating square roots or trigonometric functions.
![www.eazynotes.com Gursharan Singh Tatla Page No. 1
BRESENHAM’S CIRCLE ALGORITHM
Bresenham Circle ( Xc, Yc, R):
Description: Here Xc and Yc denote the x – coordinate and y – coordinate of the center of the
circle. R is the radius.
1. Set X = 0 and Y = R
2. Set D = 3 – 2R
3. Repeat While (X < Y)
4. Call Draw Circle(Xc, Yc, X, Y)
5. Set X = X + 1
6. If (D < 0) Then
7. D = D + 4X + 6
8. Else
9. Set Y = Y – 1
10. D = D + 4(X – Y) + 10
[End of If]
11. Call Draw Circle(Xc, Yc, X, Y)
[End of While]
12. Exit
Draw Circle (Xc, Yc, X, Y):
1. Call PutPixel(Xc + X, Yc, + Y)
2. Call PutPixel(Xc - X, Yc, + Y)
3. Call PutPixel(Xc + X, Yc, - Y)
4. Call PutPixel(Xc - X, Yc, - Y)
5. Call PutPixel(Xc + Y, Yc, + X)
6. Call PutPixel(Xc - Y, Yc, + X)
7. Call PutPixel(Xc + Y, Yc, - X)
8. Call PutPixel(Xc - Y, Yc, - X)
9. Exit](https://image.slidesharecdn.com/bresenham-circle-algorithm-130403033442-phpapp01/85/Bresenham-circle-algorithm-1-320.jpg)