# Algorithm to find common tangent to any two conics

I've read a lot of questions and answers here regarding finding common tangents to conics. Almost all of them deal separately with parabolas, circles or ellipses. Do we have any general algorithm which can be used to find the common tangents to any two conics of same type irrespective of whether it's a parabola, ellipse, hyperbola or a circle?

If the two given conics in $$x,y$$ are given by the three by three matrices $$M$$ and $$N$$, the dual conics are given by the adjugate matrices (which up to a scalar are the inverses $$M^{-1}$$ and $$N^{-1}$$ when they are invertible).

The dual conics in $$X,Y$$ intersect in at most four points $$(X_i,Y_i)$$. And the correspondence $$X_ix+Y_iy+1=0$$ give the common tangent lines.

Duality

In projective geometry there's the concept of duality: two lines have a common point is dual to two points have a common line. This extends to curves in that a line is the points on it has the dual concept that a point has the lines through it.

Now this extends to nonlinear curves by a point on a curve having a tangent picking out one line of the lines through the point. The collection of tangent lines to a curve then is a dual curve.

A common tangent to two curves then is exactly an intersection point of the dual curves.

As it happens, for conics, this is as straightforward as inverting the matrices associated to them. The only complication being that some matrices are not invertible and the process still works with the adjugate matrices then.

Example

The conics in the image are $$x^2+2xy-y^2+3x+3y+3=0,2x^2+2xy-2y^2-8x+4y+2=0$$

which through $$a_ix^2+2h_ixy+b_iy^2+2g_ix+2f_iy+c_i=0$$ have matrices

$$\begin{pmatrix} a_i&h_i&g_i\\h_i&b_i&f_i\\g_i&f_i&c_i\end{pmatrix},i=1,2$$ or

$$M=\begin{pmatrix} 1&1&\frac32\\1&-1&\frac32\\\frac32&\frac32&3\end{pmatrix},N=\begin{pmatrix} 2&1&-4\\1&-2&2\\-4&2&2\end{pmatrix}$$

The dual conics are then

$$-\frac{21}{4}x^2-\frac32xy+\frac34y^2+6x-2=0,-8x^2-20xy-12y^2-12x-16y-5=0$$ from the adjugate matrices $$\begin{pmatrix} +\begin{vmatrix}b_i&f_i\\f_i&c_i\end{vmatrix}&-\begin{vmatrix}h_i&f_i\\g_i&c_i\end{vmatrix}&+\begin{vmatrix}h_i&b_i\\g_i&f_i\end{vmatrix}\\-\begin{vmatrix}h_i&g_i\\f_i&c_i\end{vmatrix}&+\begin{vmatrix}a_i&g_i\\g_i&c_i\end{vmatrix}&-\begin{vmatrix}a_i&h_i\\g_i&f_i\end{vmatrix}\\+\begin{vmatrix}h_i&g_i\\b_i&f_i\end{vmatrix}&-\begin{vmatrix}a_i&g_i\\h_i&f_i\end{vmatrix}&+\begin{vmatrix}a_i&h_i\\h_i&b_i\end{vmatrix}\end{pmatrix}.$$

Now you can get the intersections from wolfram alpha

or Maxima

solve([-21/4 *x^2-3/2 *x*y+3/4 *y^2+6*x-2,-8*x^2-20*x*y-12*y^2-12*x-16*y-5],[x,y]);
[[x = 0.180395566181265, y = - 1.037735255240134],
[x = 0.3091137649277184, y = - 0.6697463463799764],
[x = 1.468166586883676, y = - 1.389356814701378],
[x = 2.787004998077662, y = - 3.732949087415946]]


And the common tangent lines are \begin{align}0.180395566181265x-1.037735255240134y+1&=0\\0.3091137649277184x-0.6697463463799764y+1&=0\\1.468166586883676x-1.389356814701378y+1&=0\\2.787004998077662x-3.732949087415946y+1&=0\end{align}

See wikipedia for how to put duality in coordinates and then set $$z=1$$ to get the usual $$x,y$$-plane.

Also see this which for me was the first google search hit for dual conic.

• Thank you for answering - But, I am sorry to say that this answer is way beyond my level as I need to learn about dual conics (could guess it's about two conics), adjugate matrix (know only adjoint matrix). I think this answer is helpful for others who are aware of this concept (due to the upvote(s)). I'll learn them and then try to understand this. Is there any simple method to find the common tangents without invoking advanced (to a grade 11 student) mathematics? If yes kindly specify.
– user712173
Nov 15 '19 at 16:23
• @Priya: Would it help if I wrote it out with a concrete example? Nov 15 '19 at 16:36
• I am not sure as I need to learn these concepts (these are not in our syllabus). If you could explain it with an example, no problem, please proceed. I'll do my best to understand your answer, as I wish to know at least one method to find common tangents to any two conics. Thank you.
– user712173
Nov 16 '19 at 7:14
• Thank you very much for the edit. This method seems very interesting. I've some doubts in the example: (1) Why do we need to compute "maxima" when we are asked to find the intersection points of the dual conics? (2) In the big matrix with determinants as its elements (I think it's the adjugate matrix), where should $i$ be $1$ and where must it be $2$? If possible, kindly suggest me good resources so that I could learn about dual conics in detail.