Computer Graphics

Circle using Bresenham’s Algorithm

Circle using Bresenham’s Algorithm Posted On
Posted By nehakarwal
Spread the love

What is Scan Converting a Circle using Bresenham’s Algorithm:

Scan Converting a Circle using Bresenham’s Algorithm, If the eight-way Symmetry of a circle is used to generate a circle. Using Bresenham’s Algorithm for drawing a circle, we can avoid the floating-point arithmetic and trigonometric calculations.

Using this method, part of a circle may be from 0 to 45 angle is generated and the other 7 segments are obtained by getting the reflection image of the same. To generate a circle, the points are obtained through a 45 angle.

Algorithm:

1. Set the initial values at variables.

(i) (h, k)=Coordinates of circle center.

(ii) x=0

(iii) y=circle radius (r)

(iv) d=3-2*r

2. Check whether the entire circle has been drawn

If x>y then step

3. Plot eight points with respect to the center (h, k) at current (x, y) coordinates.

Plot (x + h, y + k)                Plot (-x + h, -y + k)        

Plot (y + h, x + k)                Plot (-y + h, -x + k)

Plot (-y + h, x + k)              Plot (y + h, -x + k)

Plot (-x + h, y + k)              Plot (x + h, -y+ k)

4. Calculate the location of the next pixel

If d<0 then

d=d+4 (x-y) +10

(i) x=x+1

(ii) y=y-1

5. Goto step 2

 

Related Post

leave a Comment