Running the foo.c below prints an ellipse like
*****
* *
* *
* *
* *
* *
*****
where I hoped it might look like
***
* *
* *
* *
* *
* *
***
which doesn't have the square corners top and bottom, and is symmetric
vertically and horizontally. Some other sizes have a few doubtful
looking pixels, but this is probably the most obvious.
Nosing around the code, it's possible the +3 from the computer graphics
book might be right. I think the step is supposed to maintain
d1 == (x+1)^2*b^2 + (y-1/2)^2*a^2 - a^2*b^2
or something like that, if chucking in a debug assertion helped. Does
+1 or +3 depend whether the x++ increment is before or after the d1
step, maybe?
Incidentally, in the d1>=0 case is "2*x*1" meant to be "2*x+1"?