[comp.graphics] Need help with algorithm

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (03/18/91)

Hmm, this is a weird one, but while working on a Windows program I came
across a rather difficult (for me :-) but simple trig/geometry problem
working with the display surface.

Given the following:

   POINT P (Xp, Yp)
   ELLIPSE E (Center @ Xe, Ye)
   A rectangle bounding the ELLIPSE (W and H for width and height)

Find the location (X and Y) for the line (Xp,Yp) to (Xe,Ye) and the
ellipse's intersection....i.e. where do the line and ellipse intersection?

I am doing this calculation 10 times a second, so I am trying to keep it
fairly efficeint, and accuracy is not the most important consideration.
The display surface is using standard Cartesian coordinates (0,0 at bottom
left).

Please email responses,

Brian