Path: utzoo!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!uflorida!reef.cis.ufl.edu!jdb From: jdb@reef.cis.ufl.edu (Brian K. W. Hook) Newsgroups: comp.graphics Subject: Need help with algorithm Message-ID: <27496@uflorida.cis.ufl.EDU> Date: 18 Mar 91 13:36:10 GMT Sender: news@uflorida.cis.ufl.EDU Organization: UF CIS Dept. Lines: 22 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