Fill Circles (fastest circles)

The code for the fast circles works a treat :slight_smile: Thanks to those who
contributed it :slight_smile:

Anyone know how to do filled ones? Or even ellipses?

ellipses are a tad more difficult… i don’t know of a fast way offhand.
sorry =(

to fill a circle, simply draw a bunch of hlines (horizontal lines) using
the points, instead of plotting the points individually.
plot 8 symmetrical points here changes to 4 hlines

ei:
format is hline(x1, y, x2)

hline(xoffset+xs,yoffset+ys,xoffset-xs)
hline(xoffset+xs,yoffset-ys,xoffset-xs)
hline(xoffset+ys,yoffset+xs,xoffset-xs)
hline(xoffset+ys,yoffset-xs,xoffset-xs)

where x/yoffset is the center point and x/ys is the point from my previous
post.

this may result in some overdraw though, im not sure.–
Come away, O human child!
To the waters and the wild
With a faery, hand in hand,
For the world’s more full of weeping
than you can understand
–William Butler Yeats

Just use symmetry to draw 45deg. worth of filled circle and replicate it 8
times around your circle’s origin. If all you want to do is solid fill
then, depending on your hardware and colour depth, using 1:2 vertical
symmetry may be faster (upper part and bottom part: drawing horizontal lines
may be faster than setting individual bytes in the buffer). And if you’re
really nuts about performance you may want to use circle-specific lookup
tables for all the trig stuff.

Ellipses that are only squished circles can be done using the same algo,
just squish your x/y coordinates. General ellipses have to be done more or
less the hard way.

V.