Explain Bresenham s circle drawing algorithm, OR Explain midpoint circle algorithm for scan converting a circle.
Midpoint Circle Algorithm 1. Input radius r and circle center (x _{c }, y _{c}) , and obtain the first point on the circumference of a circle centered on the origin as (x_{0}, y_{0},) = (0, r) 2. Calculate the initial value of the decision parameter as p0 = 5/4-r 3. At each x _{k} position, starting at k = 0, perform the following test: If p _{k} <0 , the next point along the circle centered on (0,0) is (x _{k+1},y _{k}) and p _{k+1} = p _{k} + 2x _{k+1} + 1 Otherwise, the next point the circle is ( x _{k} + 1, y _{k} -1) and p _{k+1 }= p _{k}+ 2x _{k+1} + 1 -2 y _{k} where 2x _{k+1} = 2x_{k} +2 and 2y_{k+1} = 2y _{k} -2. 4. Determine symmetry points in the other seven octants. 5. Move each calculated pixel position (x, y) onto the circular path centered on (x _{c},y _{c}) and plot the coordinate values: x = x +x _{c}, y = y + y _{c} 6. Repeat steps 3 through 5 until x > y