[comp.graphics] looking for a fast ellipse algorith

mcdonald@uxe.cso.uiuc.edu (02/19/89)

>Assumptions: Your ellipse is aligned vertically (i.e. not rotated), and
>   the center (h, k) is given in rational numbers with denominator d.
>   Also, the eccentricity is small (since you say it's for a raster device,
>   I assume the pixel aspect ratio (length/width) is near one). I also assume
>   that the major and minor radii (a and b) are rational with denominator d.

Wrong, Wrong, and I guess that's OK. 

In other words, I would like the answer for arbitrary orientation
(e.g. major axis at 23 degrees to the horizontal) and eccentricity.
I have found no usefully fast answers for this. Anybody out there
have the answer? I have looked in several textbooks and never found
any help.

Doug McDonald

stanford@aostra.UUCP (curtis stanford) (02/22/89)

In article <46900031@uxe.cso.uiuc.edu>, mcdonald@uxe.cso.uiuc.edu writes:
> 
> 
> >Assumptions: Your ellipse is aligned vertically (i.e. not rotated), and
> >   the center (h, k) is given in rational numbers with denominator d.
> >   Also, the eccentricity is small (since you say it's for a raster device,
> >   I assume the pixel aspect ratio (length/width) is near one). I also assume
> >   that the major and minor radii (a and b) are rational with denominator d.
> 
> In other words, I would like the answer for arbitrary orientation
> (e.g. major axis at 23 degrees to the horizontal) and eccentricity.
> I have found no usefully fast answers for this. Anybody out there
> have the answer? I have looked in several textbooks and never found
> any help.
> 
> Doug McDonald

I don't know how fast this is or if anyone else has mentioned it but in
the November, 1988 issue of Computer Language there is a good article on
Ellipses, Parabolas, & Hyperbolas including a routine "xyellipse" to draw
so called "vertical" ellipses and a routine "angellipse" to draw ellipses
at an arbitrary angle from the x axis.  It involves calling cos and sin
just once at the beginning of the routine.  I plan on trying it soon but
at the moment I have no idea how fast it is.  The only problem is that 
"angellipse" overlaps pixels and may leave pixel wide gaps making it 
inappropriate for flood fills.

Later...

Curtis Stanford
Alberta Oil Sands Technology and Research Authority
Calgary, AB
calgary!aostra!stanford