Originally Posted by

**6tr6tr**
Thanks for posting that but for some reason, the arc (or circle) dissapears as it nears the left and right extremes. Any idea why and how to adjust that? The top and bottom show perfectly.

Found one on wikipedia that works really well! (I altered it slightly)

Code:

function drawCircle( xMidPoint, yMidPoint, radius)
{
var f = 1 - radius;
var ddF_x = 1;
var ddF_y = -2 * radius;
var x = 0;
var y = radius;
//Bottom middle
drawPixel(xMidPoint, yMidPoint + radius);
//Top Middle
drawPixel(xMidPoint, yMidPoint - radius);
//Right Middle
drawPixel(xMidPoint + radius, yMidPoint);
//Left Middle
drawPixel(xMidPoint - radius, yMidPoint);
while( x < y )
{
if(f >= 0)
{
y--;
ddF_y += 2;
f += ddF_y;
}
x++;
ddF_x += 2;
f += ddF_x;
//Lower Right
drawPixel(xMidPoint + x, yMidPoint + y);
drawPixel(xMidPoint + y, yMidPoint + x);
//Lower Left
drawPixel(xMidPoint - x, yMidPoint + y);
drawPixel(xMidPoint - y, yMidPoint + x);
//Top Right
drawPixel(xMidPoint + x, yMidPoint - y);
drawPixel(xMidPoint + y, yMidPoint - x);
//Top Left
drawPixel(xMidPoint - x, yMidPoint - y);
drawPixel(xMidPoint - y, yMidPoint - x);
}
}