Circle is a frequently used component in pictures and graphs.
Center Position : (xc , yc )
Distance : r ( Radius )
This distance relationship is expressed by the Pythagorean theorem in Cartesian coordinates as
(x – xc)2 + (y – yc)2 = r2
the above equation can be used to calculate the successive y values by stepping x values as
y = yc ± Ö r2 – (xc – x)2
but in this method, the computation time is high and spacing between pixels is not uniform. One way to eliminate the unequal spacing is to calculate points using polar coordinates r and q.
x = xc + r cos q
y = yc + r sin q
the step size for q value depends on the display device.
Computations can be reduced by considering the symmetry of circles. The shape of the circle is similar in each quadrant, more over in each octant also. Once the pixel positions at one octant is calculated its reflection can also be obtained as shown in the figure.
In these cases, the computation time is high. To reduce the computation time the midpoint algorithm used for circle drawing.
© Wiziontech Solutions | Created by Thiyagaraaj