I have been trying to find the angle made by inner tangents to two general ellipse by following the method described by Futurologist to find four homogeneous equations of tangents, this method is presented here and uses the concept of dual conics and degenerate conics. Using that method, I am able to get four tangent equations in homogeneous coordinates. However, I am looking to find the angle between the inner common tangents. For that purpose, currently, I am solving for the intersection of the four tangent lines with the ellipse and then tracing those points back to get the angle made by inner common tangents. This process is a bit computationally expensive and I am looking for a less expensive algorithm.
My question here is that if it is possible to obtain that angle directly instead of going through the hassle of finding the intersection points? I am not interested in getting the equation of tangents. I just need the angle between them.
Graphically in the diagram below, that angle can be represented as $\theta$:
Note: Using the slopes of the lines obtained from above method do not return correct answer because we do not know if that angle is greater one or smaller one (two angle made by exterior or interior to those line), it depends on the relative position of the two conics. I want a generalize solution which will work for every configuration of two given conics anywhere in the 2D space.

Preliminaries (algorithm for solving a pair of quadratic equations of two variables):
It boils down to finding an algorithm for solving a system of two quadratic equations of two variables, by interpreting it as a projective geometry pencil of conics, then finding the three degenerate conics of the pencil together with a projective transformation that simplifies these three degenerate conics to the point of your being able to read off the solutions very easily in new simplifying coordinate system, and after that transforming them back to the original coordinate system.
I sketched an algorithm in python, I think it seems to work on your example... but I was in a hurry and did not check it properly, so there may be bugs...
Some Explanations: Assume you want to find the intersection points of two conics C1 and C2. Let us assume for simplicity that they are real ellipses that intersect in four different points (to avoid complex numbers)
In the case of finding the common tangents to a pair of conics, simply convert the two conics two corresponding duals and then find the intersection points of the duals. These intersection points are the equation coefficients of the tangents of the original conics.
There are possibly several different geometric interpretations of this problem, but let us go with the pencil of conics. The two conics C1 and C2 are represented by 3 by 3 symmetric matrices with non-zero determinants, which I have denoted C1 and C2. The linear combination, called pencil of conics generated by C1 and C2, is the t-parametrized family of conics
C1 - t*C2, where t is just a number. What is crucial is that every conicC1 - tC2passes through the intersection points of C1 and C2 and these are the only four points they all have in common. You can prove this by observing that ifx.T * C1 * x = x.T * C1 * x = 0thenx.T * (C1 - t*C2) * x = x.T * C1 * x - t * x.T * C2 * x = 0 - t*0 = 0. Furthermore, if you take an intersection point ofC1andC1 - t*C2, thenC2 = C1 - t*C2 + s*C2you can apply the same argument whens = t.In this family of conics, there are three degenerate conics, that are geometrically three pairs of lines. They occur exactly when t is such that
det( C1 - t*C2 ) = 0. This is a polynomial equation of degree 3 with respect to t, so there are three, say different solutionsk[0], k[1], k[2],due to the niceness of the C1 and C2. Projectively speaking, each degenerate conicC1 - k[j]*C2is a pair of lines and they have a common intersection pointu[:,j] = [ u[0,j] : u[1,j] : u[2,j] ]. Moreover,rank(C1 - k[j]*C2) = 2, soker(C1 - k[j]*C2) = 1. This pointu[:,j]is characterized as a solution to the equation(C1 - k[j]*C2) * u[:,j] = 0. SinceC2is invertible (non-degenerate), multiply both sides of the equation byinverse(C2)and obtain the equivalent equation( (inverse(C2) * C1) - k[j]*Identity ) * u[:,j] = 0which is an eigenvalue equation, withk[j]as eigenvalue andu[:,j]as eigenvector. The output of the functiontransform()is the 1 by 3 arraykof eigenvalues and the 3 by 3 matrixU = [ u[:,0], u[:,1], u[:,2] ]of eigenvectors.Conjugating
C1 - k[j]*C2 by U, i.e. (U.T)*(C1 - k[j]*C2)*U, is geometrically equivalent to performing a projective transformation that sendsu[:,0]andu[:,1]to infinity andu[:,2]to the origin. Thus,Uchanges the coordinate system from a general one to a special coordinate system, in which two of the degenerate conics are given by pairs of parallel lines and combined they intersect in a rectangle. The third conic is represeneted by the diagnols of the rectangle.In this new picture, the intersection problem can be easily solved, just by reading off one solution from the entries of the matrices
(U.T)*(C1 - k[j]*C2)*U(the intersection points are the vertices of the rectangle, so if you find one of them, the others are simply mirror symmetric of each other).Some explanations on how the solutions in special coordinates are obtained.
Since, by construction (by the special choice of eigenvalues
k[0]andk[1]) the original conicsC1 - k[0]*C2andC1 - k[1]*C2are degenerate and thus a pair of lines each, after the projective transformationU, which simplifies the conics and represents them by the matricesL1 = (U.T)*(C1 - k[0]*C2)*UandL1 = (U.T)*(C1 - k[0]*C2)*U, are diagonal and thus geometrically each of these is a pair of lines, parallel one of the coordinate axes, e.g.L1is a pair of lines parallel toxandL2is a pair of lines parallel toy. Also for each degenerate conic, the pair of lines are symmetric with respect to the coordinate axes. Hence, the four intersection points form the vertices of a rectangle, mirror symmetric relative to the coordinate axes. Thus, the intersection points are of the projective formso it is enough to find only one of them and then reflect it across the coordinate axes. In the simplifying coordinate system, the conic
L1has the an equation like thiswhere the two lines are
a1*y = b1anda1*y = -b1so theycoordinate of one of the solutions should bey = abs(b1/a1). If you expand the equation, you get the quadratic equationand in matrix form
Hence, the
ycoordinate of one solution isIf you do the same for the conic
L2, but this time thinking about it being a pair of symmetric lines parallel to theyaxis, then you get thexcoordinate of a solutionThat is why, one solution is
Then all solutions are obtained by reflecting in the coordinate axes:
Algorithm for calculating the angle between the internal tangents:
Calculating the angle bisector line of the inner tangents.
Here is a routine that, given a pair of lines
line1andline2, represented by vectors with three coefficients, calculates the three coefficients of the angle bisector line that splits the angle in half. It also returns the slope of the tangent line, as the ratio of the y-increase divided by the x-increase.