I am trying to determine the direct and transverse lines for two non-overlapping ellipses. I specifically mean that the two ellipses are totally separated from each other with no shared regions. I have been working out a general solution using the implicit definition of a conic section, though specific to an ellipse.
Given the definition of a general conic section: $$ ax^2+bxy+cy^2+dx+ey+f=0 $$ A point on ellipse E1 is thus defined as Equation 1 (assumed that $a_1$, $b_1$, $c_1$, $d_1$, $e_1$, and $f_1$ are known): $$ a_1x_1^2+b_1x_1y_1+c_1y_1^2+d_1x_1+e_1y_1+f_1=0 $$ A point on ellipse E2 is similarly defined as Equation 2 (likewise assumed that $a_2$, $b_2$, $c_2$, $d_2$, $e_2$, and $f_2$ are known): $$ a_2x_2^2+b_2x_2y_2+c_2y_2^2+d_2x_2+e_2y_2+f_2=0 $$ The tangent of the conic section for any point $(x,y)$ can be obtained via implicit differentiation of the equation for the conic section above: $$ 2ax+b[y+\frac{dy}{dx}]+2cy\frac{dy}{dx}+d+e\frac{dy}{dx}=0 $$ which becomes: $$ \frac{dy}{dx}[bx+2cy+e]=-2ax-by-d $$ Solving for $\frac{dx}{dy}$ yields: $$ \frac{dy}{dx}=\frac{-2ax-by-d}{bx+2cy+e} $$ For the two tangent points of ellipses E1 and E2, relationships can be established between the slope of the tangents points and the slope of the line connecting $(x_1,y_1)$ and $(x_2,y_2)$: $$ \frac{-2a_1x_1-b_1y_1-d_1}{b_1x_1+2c_1y_1+e_1}=\frac{y_2-y_1}{x_2-x_1}, \frac{-2a_2x_2-b_2y_2-d_2}{b_2x_2+2c_2y_2+e_2}=\frac{y_2-y_1}{x_2-x_1} $$ Through some further mathematical machinations (namely bring the denominators out from under the numerators, multiplying out the terms, and bringing all terms on the left-hand side of the equation), these two equations can be restated to obtain Equation 3: $$ 2a_1x_1^2+2b_1x_1y_1+d_1x_1-2a_1x_1x_2-b_1x_2y_1-d_1x_2-b_1x_1y_2-2c_1y_1y_2-e_1y_2+2c_1y_1^2+e_1y_1=0 $$ and Equation 4: $$ -2a_2x_2^2-2b_2x_2y_2-d_2x_2+2a_2x_1x_2+b_2x_1y_2+d_2x_1+b_2x_2y_1+2c_2y_1y_2+e_2y_1-2c_2y_2^2-e_2y_2=0 $$ These four equations with four unknowns ($x_1$, $y_1$, $x_2$, and $y_2$) should then be solvable. I have attempted to do so using the Groebner basis, as implemented through a Matlab library found on the Matlab Central File Exchange. While the library does work, I have not been able to obtain a solution to the system of four multivariate polynomial equations listed above. Am I missing something or is my math incorrect or poorly formed?
Thanks in advance for any assistance!
I'd suggest a different approach. Choose a coordinate system with origin at the center of the first ellipse $E_1$ and aligned with its axes of symmetry. We can then parameterize $E_1$ as $$ x = a\cos\theta \quad ; \quad y = b\sin\theta $$ The tangent line $L_{\theta}$ at the point $(a\cos\theta, b\sin\theta)$ has parametric equations $$ L_{\theta}(t) = \big(a(\cos\theta - t\sin\theta),\; b(\sin\theta + t\cos\theta)\big) $$ Suppose the other ellipse $E_2$ has implicit equation $F(x,y)=0$. The line $L_{\theta}$ intersects $E_2$ at values of $t$ that satisfy $F(L_{\theta}(t))=0$. This latter is a quadratic in $t$. The line $L_{\theta}$ will be tangent to $E_2$ when this quadratic has two equal roots. So, we write down the condition that it has equal roots, which be an equation involving $\theta$ that we will then need to solve for $\theta$.
How to solve? Well, the equation will contain quadratic terms in $\sin\theta$ and $\cos\theta$. So, we use the Weierstrass substition: $$ u = \tan\tfrac12\theta \quad ; \quad \cos\theta = \frac{1 - u^2}{1 + u^2} \quad ; \quad \sin\theta = \frac{2u}{1 + u^2} $$ This will give you a single fourth-degree equation in $u$, which (in theory) you can solve. Each value of $u$ will give you a value of $\theta$ for which the corresponding line $L_{\theta}$ is tangent to both ellipses.