i'm writing a c code to implement a circle using Midpoint algorithm ..but when i run the program i just see half the circle ( only one quadrant ) where is the rest ?????????
void MidpointCircle ( int radius, int color )
{
int x, y;
float d;
x = 0;
y = radius;
d = 5.0 / 4 - radius;
CirclePoints ( x, y, color );
while ( y > x ) {
if ( d < 0 ) {
d += x * 2.0 + 3;
x ++;
}
else {
d += (x - y) * 2.0 + 5;
x ++;
y --;
}
CirclePoints ( x, y, color );
}
}
void CirclePoints (float x, float y, int color)
{
putpixel ( x, y, color );
putpixel ( y, x, color );
putpixel ( y, -x, color );
putpixel ( x, -y, color );
putpixel ( -x, -y, color );
putpixel ( -y, -x, color );
putpixel ( -y, x, color );
putpixel ( -x, y, color );
}