How to get the angle between the imaginary inner common tangents when two ellipse intersect with each other This question is a follow-up on the previous question asked in this thread where we discussed a strategy to find the angle between inner common tangents to two ellipse whose equations are given by:
$ AX^{2}+BXY+CY^{2}+DX+EY+F=0 $
In that approach, we did not use any equation solver and was able to get the angle between inner common tangents by just using the linear algebra and the concepts of projective geometry which made the solutions very computationally efficient. I am looking for a solution along those lines for a slightly different problem.
In the last thread we did not realize that the two ellipse can intersect with each other and the imaginary tangents would still exist. I am using the word imaginary because if the two ellipse intersect then there is no physical meaning of inner common tangents.
Usually, there will be three cases:

*

*In the first case, the two ellipse do not intersect and the approach discussed in the earlier thread would work to find the inner common tangent angle. This angle will be 0 degrees when the two ellipse are infinitely apart and keeps on increasing as the two ellipse comes closer and closer. It can be noted that this angle will always be less than 180 degrees because the two ellipse never intersect.




*In the second case, the two ellipse will intersect each other at only one point with no overlap and as a result the two inner common tangents will coincide with each other and angle between them would be exactly 180 degrees.



*In the third case, the two ellipse will overlap and intersect at two, three or four points. In this case, the angle between the inner common tangents should be 180 degrees + some complex number. The magnitude of this complex number would represent the degree of penetration. Greater magnitude represents greater penetration.

To illustrate this imaginary tangent concept for a circle, let us consider that the angle between inner common tangents is given by the following equation:
\begin{equation}
\theta = 2\ sin^{-1}(\frac{R_1 + R_2}{r}) \end{equation}
where $R_1$ and $R_2$ are the radii of two circles, $r$ is the distance between the centre of the two circles. These quantities can be referred from the following figure:

Now, it can be seen that this angle $\theta$ is always defined even when the two circles intersect with each other. If they are non-intersecting $(R_1+R_2<r)$ then the angle would be purely real, if they are intersecting $(R_1+R_2>r)$ then the angle is 180 degrees + some complex number and finally if they touch each other at only one point $(R_1+R_2=r)$ then this angle would be 180 degrees. Usually, the more the magnitude of complex number, the deeper the overlap of two entities.
This concept is well defined for the case of circle. However, there is an equivalent concept of imaginary tangents in case of ellipse and I am not aware of how to compute this imaginary angle. I only know non-deterministic method of doing that. I hope my question is clear. Please help me out with the deterministic solution for the ellipse case. Thanks!
 A: This will be a bit different, but if you know the slopes of the lines, then one can find the angle between them like this. I suppose you could take the derivative of the ellipse and equate them to find the common tangent.
There is a great short video by “Senzen” and at the end of the video, a formula for your problem is shown. Video. The derivative will give the tangent line slopes and will turn the constant into 0.
$$\mathrm{C=\frac{d}{dx}\left(A((y-b)sinθ+(x-a)cosθ)^2+B((y-b) cosθ-(x-a) sinθ)^2=1\right),D= \frac{d}{dx}\left(A_2((y-b_2)sinθ+(x-a_2)cosθ)^2+B_2((y-b_2) cosθ-(x-a_2) sinθ)^2=1\right)=0}$$
To find the slope of the lines, simply solve for x in:
$$\mathrm{C=D\implies 2 A (cos(θ) + sin(θ) y'(x)) ((x - a) cos(θ) + sin(θ) (y(x) - b)) + 2 B (cos(θ) y'(x) - sin(θ)) (cos(θ) (y(x) - b) - (x - a) sin(θ)) = 2 A_2(cos(θ) + sin(θ) y'(x)) ((x - a_2) cos(θ) + sin(θ) (y(x) - b_2)) + 2 B_2 (cos(θ) y'(x) - sin(θ)) (cos(θ) (y(x) - b_2) - (x - a_2) sin(θ))=0}$$
Once the values for x are found which solve the equation, plug these into either C(x) or D(x) as each solved value will give the same slope. When you found 2 lines of slope $m_{1,2}$, the angle will be given in closed form as:$$\mathrm{\theta=tan^{-1}\left(\frac{m_2-m_1}{1+m_1m_2}\right)}$$
Here is a demo. Please correct me and give me feedback!
A: Another way to look at imaginary tangents:
Angle between real tangents and imaginary roots of non-intersecting ellipses  can be found just as between imaginary tangents and real roots of intersecting ellipses. There is a one to one correspondence. The following is given even if it may appear vague at the outset.
Consider an analogous situation with respect to tangent points of a simpler conic, the parabola instead of an ellipse.
$$ y = ax^2+bx+c=0  ,\; \Delta= b^2-4 ac \;\tag1$$
When parabola does not intersect x-axis, the complex roots are given by
$$(x_1,y_1)= \dfrac{ -b\pm \sqrt{-\Delta}}{2a}\tag2$$
and tangent points from the closest point on x-axis are given by
$$(x_1,y_1)= \left( \dfrac{ -b\pm \sqrt{-\Delta}}{2a}, \dfrac{-\Delta}{2a}\right)\tag3 $$
Angle between imaginary tangents
$$ \gamma= 2 \tan^{-1}\dfrac{\dfrac{\sqrt{-\Delta}}{2a}}{\dfrac{-\Delta}{2a}} = 2 \cot^{-1}{\sqrt{-\Delta}} \tag4$$
An example is the disposition of tangents and depiction of complex roots in the complex plane :
$$ x^2-3x+4=0, \text{Roots}: ((3\pm i \sqrt{7})/2,7/2)$$
Real roots and imaginary tangents occur when the parabola is brought down to intersect x-axis
$$  y= ax^2+bx +c- \frac{ 4ac-b^2}{2a} \tag 5 $$
with real roots of parabola
$$(x_0,y_0)= \dfrac{ -b\pm \sqrt{\Delta}}{2a}\tag6$$
in the example
$$ x^2-3x +\frac12=0 \tag 7 $$

