Showing posts with label circle drawing algorithm. Show all posts
Showing posts with label circle drawing algorithm. Show all posts

Monday, November 9, 2015

circle drawing algorithm



Implementation of Midpoint Circle Algorithm
voidcircleMidpoint (int xCenter, int yCenter, int radius)
{
int x = 0; int y = radius;
int p = 1 - radius;
voidcirclePlotPoints (int, int, int, int); /* Plot first set of points */
irclePlotPoints (xCenter, yCenter, x, y);
while (x < y)
 {
 x++ ;
if (p < 0) p +=2*x +1;
else
{
y--; p +=2* (x - Y) + 1;
}
circlePlotPoints(xCenter, yCenter, x, y)
}
}