# Conic by three points and two tangent lines

With the exception of degenerate situations, a conic is uniquely determined by five points lying on it. Likewise, five lines tangent to a conic uniquely define that conic. With four points and one tangent line, there are in general two conics meeting these requirements, and by duality, the same holds for four tangents and one point. Two cases remain, one dual to the other, namely three points and two tangents and vice versa. In those cases, there are in general four possible solutions. Some of them may be complex.

What's the most elegant way to find these four conics which pass through three given points $A,B,C$ and are tangent to two given lines $g,h$?

I have some algorithm to do this, but its core lies in finding roots of two distinct quartic equations, one for either touching point, and then pairing solutions numerically. The coefficients of the quartic equations are huge, both in term of space they need to write down and of how big the numbers get. I might add this approach as an answer eventually if nothing better turns up.

I hope someone finds a way to translate this problem into the intersection of two conics, in such a way that each point of intersection corresponds to one solution without any need to match things. But other elegant solution would be welcome as well.

• This does not seem like a problem that can be solved without solving a quartic. I tried giving sagemath an expression that would pop out the solutions directly (while solving a quartic) but I ran out of memory. I guess we should be happy it's not a quintic. – Alice Ryhl Jan 27 '15 at 20:42
• @KristofferRyhl: I agree that the quartic might essentially be unavoidable, except for the fact that one can use a cubic to solve a quartic. But my main problem with my approach is the ugly fact that I need to match solutions from two different equations. A single quartic which determines all required parameters simultaneously would be a huge step forward. And the intersection of two conics looks like just that: four possible solutions, each with two coordinates. Hence my hope that this problem can somehow be reduced to intersecting conics. – MvG Jan 27 '15 at 21:03
• Trying to understand how these lines are formed. Is it correct to assume that an oblique cone has vertex at O, the intersection of two of cone generator projections f and g, and also that the cone is cut by four planes three of which produce intersections AB,BC and CA? – Narasimham Feb 6 '15 at 11:43
• @Narasimham: I view the whole setup as purely planar, using the term “conic section” as a synonym for a quadric. But it might well be that viewing all of this as an orthogonal projection of a 3D cone (probably even a right cone) can be leveraged to obtain a very elegant answer. Hadn't thought about that before, but doing so might boil the whole thing down to a bunch of quadratic equations, even simpler what I hoped for. Do you want to write an answer, or shall I try to work out the details based on this idea? – MvG Feb 6 '15 at 12:53
• @MvG.You can work it out, but wait, there is perhaps a more powerful, may be even less laborious method with Pole and Polar on an ellipse. Chelsea Publishing book on Conic sections refers to this topic as also I believe classic references in German and French. – Narasimham Feb 6 '15 at 13:20

The comment by Narasimham made me aware of a very elegant way of tackling this problem. The figure above can be interpreted as the orthogonal projection of a right cone whose axis lies in the plane. The cone intersects the plane in the two lines, $g$ and $h$. The points $A,B,C$ are in fact points on the cone, so they lie either above the plane or below the plane but are projected orthogonally into the plane. These three points in space define a plane, and that plane intersects the cone in a conic section. The orthogonal projection of that conic section is again a conic section, namely one of the four indicated in the figure. The four different solutions come from different choices about which of the points $A,B,C$ lie above the plane and which below. Since reflecting everything in the plane doesn't affect the resulting projected conic, one of the three points can be chosen arbitrarily, while the other two each allow for two possible choices, leading to $2^2=4$ generally distinct solutions.

So let's make this a bit more explicit. Using a suitable projective transformation defined by four points and their images, one can achieve a situation where the lines $g$ and $h$ intersect in the point $(0:0:1)$, the line $g$ intersects the line $AB$ in $(1:0:0)$ and the line $h$ intersects the line $AB$ in $(0:1:0)$. Furthermore, $C=(1:1:1)$ can be the fourth point defining this transformation. Then $A=(a:1:0)$ and $B=(b:1:0)$ describe the situation up to that projective transformation, so we only have to deal with two parameters $a,b\in\mathbb R$ except for some degenerate situations (like when $A$ or $B$ lies on $h$).

Now lift everything up to the cone. That cone has an aperture of $\frac\pi2$. In affine coordinates, you can describe it as the set of points $(x,y,z)$ which satisfies $(x + y)^2 = x^2 + y^2 + z^2$ or in other words $2xy = z^2$. But we are free to scale the $z$ coordinate by $\sqrt2$ so we might as well use

$$xy=z^2\tag1$$

as the equation of the cone. That equation is already homogeneous, so we can plug coordinates $(x:y:z:w)$ into that and find that $w$ is irrelevant. Translating out 2d points above to 3d we obtain $A=(a:1:\pm\sqrt a:0)$ and $B=(b:1:\pm\sqrt b:0)$ as well as $C=(1:1:1:1)$. The plane spanned by these three points is characterized by

$$\begin{vmatrix}1&\pm\sqrt a&0\\1&\pm\sqrt b&0\\1&1&1\end{vmatrix}x -\begin{vmatrix}a&\pm\sqrt a&0\\b&\pm\sqrt b&0\\1&1&1\end{vmatrix}y +\begin{vmatrix}a&1&0\\b&1&0\\1&1&1\end{vmatrix}z -\begin{vmatrix}a&1&\pm\sqrt a\\b&1&\pm\sqrt b\\1&1&1\end{vmatrix}w =0\tag2$$

If we introduce new symbols $p_i$ for the coefficients of this plane, we can shorten this to

\begin{align*} p_1x + p_2y + p_3z + p_4w &= 0 \\ p_1x + p_2y + p_4w &= -p_3z \\ (p_1x + p_2y + p_4w)^2 &= p_3^2xy \tag3 \end{align*}

This is a homogeneous quadratic equation in $(x:y:w)$ and as such describes a conic in the original plane. Now one might want to undo the projective transformation which led to the special coordinates, and then we are done. The four possible choices for the signs of $\pm\sqrt a$ and $\pm\sqrt b$ will lead to the four possible conics.