im trying to get a perfect circle going here
im using this code below.
its not exactly a perfect circle though
more like a Octacontagon its circular but with rough edges
any suggestions?

Code:
void circle(int rx, int ry, int r)
{
int x,y;
double d;//detail
const double pi = 3.14159265; //more or less
for(d=0; d<=2*pi; d+=0.01) //you can play with the value to be added to d
{
x=rx+sin(d)*r;
y=ry+sin(d+(pi/2))*r;
putpixel(x,y);
}
}