Intersection between a line and an ellipse

Lets consider a line having slope $ \zeta$ and containing the test point $ A$.

Figure 2: line/ellipse intersection

\begin{picture}(1000,600)
\textcolor[gray]{0.5}{
\put(0,50){\vector(1,0){1000}...
...ut(480,85){\mbox{$\varphi$}}
\qbezier(475,50)(475,81)(447,94)
}%
\end{picture}

For well chosen $ \zeta$ values, this line intersects the ellipse. Let $ (r',z')$ be the cartesian coordinates of the intersection point $ P(\varphi)$:

\begin{equation*}\left\{\begin{aligned}r' &= r-k\cos\zeta\\ z' &= z-k\sin\zeta \end{aligned}\right.\end{equation*}

where $ k$ is the signed distance between the test point $ A$ and the intersection point $ P(\varphi)$. $ k$ is positive if the test point is outside of the ellipse and negative otherwise. Note that the sign of $ k$ implies the choice of the line orientation, so depending on the test point location inside or outside of the ellipse, we have to choose either $ \zeta$ or $ \pi-\zeta$; the following equations take care of this choice. Since the intersection point $ P(\varphi)$ belongs to the ellipse, its coordinates verify equation:

    $\displaystyle \left(\frac{r'}{a_e}\right)^2+\left(\frac{z'}{(1-f)a_e}\right)^2 = 1$

introducing the test point coordinates and the signed distance $ k$

      $\displaystyle \left(\frac{r-k\cos\zeta}{a_e}\right)^2+\left(\frac{z-k\sin\zeta}{(1-f)a_e}\right)^2 = 1$
    $\displaystyle \Leftrightarrow\quad$ $\displaystyle (1-f)^2[(r-k\cos\zeta)^2-a_e^2] + (z-k\sin\zeta)^2 = 0$
(5) $\displaystyle \Leftrightarrow\quad$ $\displaystyle a k^2 - 2b k + c = 0$   where$\displaystyle \quad \left\{\begin{aligned}a &= (1-f)^2\cos^2\zeta+\sin^2\zeta\\...
...(1-f)^2r\cos\zeta+z\sin\zeta\\ c &= (1-f)^2(r^2-a_e^2)+z^2 \end{aligned}\right.$

Luc Maisonobe 2006-02-04