Find all inscribed ellipses in a given triangle passing through two given internal points

93 Views Asked by At

Given a triangle, and two points inside it, I want to determine all the ellipses that are inscribed in the triangle and passing through both of the two given points.

My attempt: is outlined in my solution below.

Your comments, hints, and answers are highly appreciated.

3

There are 3 best solutions below

1
On BEST ANSWER

Suppose an inellipse is tangent to the side-lines of $\triangle ABC$ at $D$, $E$, $F$ (with $D$ on $BC$, etc). It is "known" (see, for instance, Wikipedia's "Inellipse" entry) that the lines $AD$, $BE$, $CF$ concur at the Brianchon point of the inellipse. Thinking backwards, we can choose an ostensible Brianchon point $K$, define $D$, $E$, $F$ as the points line $AK$, $BK$, $CK$ meet the triangle's side-lines, and determine the corresponding inellipse.

The forms are a bit neater if we use $u:v:w$ barycentric coordinates. For instance, let our starting point have these coordinates $$K \;=\; u_K : v_K : w_K \qquad\text{that is,} \quad K = \frac{u_K A + v_K B + w_K C}{u_K + v_K + w_K}$$ Then $$D \;=\; 0:v_K:w_K \qquad E \;=\; u_K:0:w_K \qquad F \;=\; u_K:v_K:0$$ and one can verify that the inellipse has this equation $$ \left(\frac{u}{u_K}\right)^2 + \left(\frac{v}{v_K}\right)^2 + \left(\frac{w}{w_K}\right)^2 -2 \frac{v}{v_K}\,\frac{w}{w_K} -2 \frac{w}{w_K}\,\frac{u}{u_K} -2 \frac{u}{u_K}\,\frac{v}{v_K} =0 \tag1$$ If the inellipse must also pass through given points $P$ and $Q$ with coordinates $$P \;=\; u_P:v_P:w_P \qquad Q \;=\; u_Q:v_Q:w_Q$$ then "all we have to do" is substitute those coordinates into $(1)$ to get a homogeneous system in $u_K$, $v_K$, $w_K$, solve the system for $v_K$ and $w_K$, substitute back into $(1)$, and clear the $u_K$ factors. This seems like a daunting task until we observe that the left-hand side of $(1)$ factors as $$\left(\frac{u'}{u_K'}+\frac{v'}{v_K'}+\frac{w'}{w_K'}\right) \left(-\frac{u'}{u_K'}+\frac{v'}{v_K'}+\frac{w'}{w_K'}\right) \left(\frac{u'}{u_K'}-\frac{v'}{v_K'}+\frac{w'}{w_K'}\right) \left(\frac{u'}{u_K'}+\frac{v'}{v_K'}-\frac{w'}{w_K'}\right)$$ where $x' := \sqrt{x}$. (Note that points inside $\triangle ABC$ have non-negative barycentric coordinates, so we need not worry about any complexities here.) We can even ignore the necessarily-non-negative first factor. Thus, the solving process effectively involves nine pairs of linear equations; the nine results have the form $$u_K' : v_K' : w_K' \;=\; \frac{\pm1}{v_P'w_Q' \pm w_P' v_Q'} : \frac{\pm1}{w_P'u_Q' \pm u_P'w_Q'} : \frac{\pm1}{u_P'v_Q' \pm v_P'u_Q'} $$ for various combinations of $\pm$. However, since left-hand side is a proportion of non-negative square roots, each triple of components on the right-hand side must share a sign (if it's negative, we can divide it out). Ultimately, we find ourselves with four viable candidates for the coordinates of $K$; namely,

$$ u_K:v_K:w_K \;=\; \frac{1}{(v_P'w_Q'+\sigma_1 w_P' v_Q')^2} : \frac{1}{(w_P'u_Q' + \sigma_2 u_P'w_Q')^2} : \frac{1}{(u_P'v_Q' + \sigma_3 v_P'u_Q')^2} $$ where $$(\sigma_1,\sigma_2,\sigma_3) \;=\; (-1,1,1),\; (1,-1,1), \;(1,1,-1), \;(-1,-1,-1) $$

Substituting back into $(1)$ doesn't offer any symbolic benefits, so I won't bother.


Taking the example from OP's solution of $A=(0,0)$, $B=(14,0)$, $C=(5,12)$, $P=(6,1)$, $Q=(7/2,6)$, we have $$u_P:v_P:w_P \;=\; 87:67:14 \qquad\qquad u_Q:v_Q:w_Q \;=\; 6:1:7$$ and then $$ u_K:v_K:w_K \;=\; \frac{1}{(\sqrt{469}+\sigma_1\sqrt{14})^2}: \frac{1}{(\sqrt{609}+2\sigma_2\sqrt{21})^2}: \frac{1}{(\sqrt{402}+\sigma_3\sqrt{87})^2} \\[4pt] $$

The Cartesian equations of the resulting inellipses are $$\begin{align} 0 &= 16468 x^2 + 13412 y^2 - 2019 x y - 169792 x - 94500 y + 519106 \\ &- 14 \sigma_1 \sqrt{29} (144 x^2 + 11 y^2 - 140 x y - 828 x + 613 y) \\ &- \phantom{1}7 \sigma_2 \sqrt{134} (48 x^2 - y^2 + 112 x y - 948 x - 575 y + 3864) \\ &- \phantom{1}2 \sigma_3 \sqrt{3886} (12 x^2 - 91 y^2 + 19 x y - 168 x + 553 y)) \end{align}$$

Visually, they seem to match nicely with OP's result, so I'll consider our answers compatible.

enter image description here

0
On

It is well-known that there's an infinite number of inscribed ellipses in any given triangle.

The equation of such an inscribed ellipse is of the form

$ (r - r_0)^T Q (r - r_0) = 1 \hspace{26pt}(1) $

which is also equivalent to the following form

$ r^T Q r + r^T b + c = 0 \hspace{26pt}(2)$

where $ r = [x, y]^T $, $r_0$ is the center of the ellipse, $Q$ is a $2 \times 2 $ positive definite symmetric matrix. In the second form we have $ b = - 2 Q r_0 $ and $ c = r_0^T Q r_0 - 1 $.

Equation $(2)$ can be written compactly as follows:

$ w^T Q_0 w = 0 \hspace{26pt}(3)$

where $ w = \begin{bmatrix} r \\ 1 \end{bmatrix} $ is a $3 \times 1$ vector. And the $3 \times 3 $ matrix $Q_0$ is specified by

$ Q_0 = \begin{bmatrix} Q && \dfrac{1}{2}b \\ \dfrac{1}{2} b^T && c \end{bmatrix} \tag{4} $

Using the methods of projective geometry, it is known that if the line

$ u_1 x + u_2 y + u_3 = 0 $

is tangent to the conic specified by $(3)$ then $ u = [u_1, u_2, u_3]^T$ satifies,

$$ u^T Q_0^{-1} u = 0 \tag{5}$$

And this is our starting point. Using the three given vertices of the triangle, we'll construct the equations of three sides of the triangle, and use those in equation (5), to determine $Q^{-1}$.

Determining the equation of the line between vertex $P_i$ and $P_{i+1}$ is performed as follows. Define the vector

$ v_i = P_{i+1} - P_i $

Then the equation of the line connecting $P_{i} $ with $P_{i+1}$ is

$ (E v_i)^T ( \mathbf{r} - P_i ) = 0 $

where $ E = \begin{bmatrix} 0 && 1 \\ -1 && 0 \end{bmatrix} $

So that the first two entries of vector $u_i$ are given by $E v_i$ and the third entry is $( - (E v_i)^T P_i ) $.

So for each of the three sides, we have thus calculated the vector $u_i, i = 1, 2, 3$

The quadratic form given by equation $(5)$ when expanded becomes:

$ A_{11} u_1^2 + A_{22} u_2^2 + A_{33} u_3^2 + 2 A_{12} u_1 u_2 + 2 A_{13} u_1 u_3 + 2 A_{23} u_2 u_3 = 0 \tag{6}$

where matrix $A = Q_0^{-1}$

There are six unknowns in this equation, which are the $A_{ij}'s$. Using the three $u_i$'s for the three sides, we can write $3$ of these equations. The solution of this $3 \times 6$ system is as follows

$ X = [A_{11}, A_{22}, A_{33}, A_{12}, A_{13}, A_{23} ] = \lambda ( X_0 + t X_1 + t X_2) , where $\lambda, t, s \in \mathbb{R} \tag{7}$

The scalar $\lambda$ does not affect the calculation of $Q$, and can be taken as unity.

We thus have matrix $A = A_0 + t A_1 + s A_2$, from which we calculate $Q_0 = A^{-1} = (A_0 + t A_1 + s A_2)^{-1}$.

Now comes the part where we impose the restriction that this ellipse passes through the two given internal points. Let these points be $r_1$ and $r_2$, then we want

$ r_1^T Q_0 r_1 = 0\tag{8}$

and

$ r_2^T Q_0 r_2 = 0 \tag{9}$

i.e.

$ r_i^T (A_0 + t A_1 + s A_2)^{-1} r_i = 0\tag{10} $

from which

$ r_i^T \dfrac{\text{adj}( A_0 + t A_1 + s A_2 ) }{| A_0 + t A_1 + s A_2 |} r_1 = 0 \tag{11} $

and this gives,

$ r_i^T \text{adj}( A_0 + t A_1 + s A_2 ) r_i = 0 \tag{12}$

The adjugate matrix, $\text{adj}( A_0 + t A_1 + s A_2)$ has entries that can computed from the entries of $A_0$, $A_1$, and $A_2$ and they will be all quadratic polynomials in $t$ and $s$.

Equation $(12)$ with $i=1,2$ gives a system of two quadratic polynomials in $t$ and $s$, which can have $0$ to $4$ solutions. Once we find the solutions (if any), then we've determined $A$ and from it, $Q_0$.

Matrix $Q_0$ found, is a scalar multiple of the actual $Q_0$, i.e.

$ Q_0 = \begin{bmatrix} s Q && \dfrac{1}{2} s b \\ \dfrac{1}{2} s b^T && s c \end{bmatrix} $

The scalar $s$ is unknown. Using matrix $Q_0$, we can find the center of the ellipse as follows

$ r_0 = - \dfrac{1}{2} (\mu Q) ^{-1} (\mu b) = - \dfrac{1}{2} Q ^{-1} b$

Note that in the above calculation we're using $(\mu Q)$ and $(\mu b)$ which we have.

Having found the center $r_0$, the equation of the ellipse is

$ (r - r_0)^T (\mu Q) (r - r_0) = \mu c + r_0^T(\mu Q) r_0 $

Therefore,

$ (r - r_0)^T \left( \dfrac{ \mu Q }{ \mu c + r_0^T (\mu Q) r_0 } \right) (r - r_0) = 1 $

Comparing this to

$ (r - r_0)^T Q (r - r_0) = 1 $

We get our $Q$ as

$ Q = \dfrac{ \mu Q }{ \mu c + r_0^T (\mu Q) r_0 } $

Finally to obtain the parameters of this ellipse, diagonalize $Q$ as follows

$ Q = R \ D \ R^T $

The diagonal entries of $D$ are the reciprocal of the square of the semi-major and semi-minor axes (in some order), and $R$ is the rotation matrix whose columns are unit vectors that point in the direction of these axes.

As a numerical example, I took the vertices of the triangle to be

$ P_1 (0,0), P_2 (14, 0), P_3(5, 12)$

and $r_1 = (6,1) $ and $r_2 = (3.5, 6) $

Applying the method above, I found four solution ellipses (this is the maximum number of ellipses). These are shown in the figure below.

enter image description here

1
On

Here is a solution based on parabolas, ultimately transformed by a projective transformation into ellipses.

The parabolas in question will be constructed as quadratic Bezier curves.

Consider the following issue : being given a system of cartesian coordinates and 2 points $P_1$ and $P_2$ in its first quadrant, find all parabolas passing through these points and tangent to the coordinate axes.

enter image description here

Any parabola can be written (in many different ways) as a quadratic Bézier curve under the form :

$$M(t)=(1-t)^2P_1+2t(1-t)P_0+t^2P_2\tag{1}$$

where, here, $P_1$ and $P_2$ are given and $P_0$ (the intermediate point) is unknown, with $P_k=(x_k,y_k)$.

Let us recall that its tangent vector in $M(t)$ is :

$$M'(t)=2[(t-1)P_1+(1-2t)P_0+tP_2]\tag{2}$$

Let $t_1$ be the value of parameter $t$ for which the curve is tangent to the $x$-axis. This tangency is expressed by saying that both the ordinates of $M(t_1)$ and $M'(t_1)$ are zero ; using (1) and (2), it means that :

$$\begin{cases}(1-t_1)^2x_1+2t_1(1-t_1)x_0+t_1^2x_2&=&0\\ t_1(x_1-2x_0+x_2)&=&x_1-x_0\end{cases}\tag{3}$$

The same type of constraint for the tangency to the $y$ axis yields :

$$\begin{cases} (1-t_2)^2y_1+2t_2(1-t_2)y_0+t_2^2y_2&=&0\\ t_2(y_1-2y_0+y_2)&=&y_1-y_0\end{cases}\tag{4}$$

(3) and (4) constitute a system of four equations in four unknowns $t_1,t_2,x_0,y_0$ ; this system has in general 4 solutions (see figure).

Once these values are obtained, how to connect these parabolas to the ellipses of the question ? Let us remember that, from a projective point of view, a parabola is tangent to the line at infinity. Therefore we have to find, in a first step, a projective transformation mapping the line at infinity to a line at finite distance, for example with equation $x+y=1$ (featured in red on figure 2).

enter image description here

Such a transformation is :

$$X=\frac{x}{x+y+1}, \ \ Y=\frac{y}{x+y+1}\tag{5}$$

In this way, we obtain the parametric equations of the different ellipses that are tangent to the sides of right isosceles triangle $ABC$ with $A(0,0),B(1,0),C(0,1)$ and passing through the images of points $P_1$ and $P_2$ by transformation (5).

We still need a last step : applying another projecting transform mapping triangle $A,B,C$ onto the final triangle.

I will not do these computations explicitly because the interest of such an answer is more in the methodology than in the detailed calculations.

Here is the Sage program which has generated figure 2 :

var('x0 y0 x1 y1 x2 y2 t1 t2 t x y k');
x1=1;y1=3;x2=3;y2=2;
eq1=t1*(x1-2*x0+x2)==x1-x0;
eq2=t2*(y1-2*y0+y2)==y1-y0;
eq3=(1-t1)^2*x1+2*t1*(1-t1)*x0+t1^2*x2==0;
eq4=(1-t2)^2*y1+2*t2*(1-t2)*y0+t2^2*y2==0;
s=solve([eq1,eq2,eq3,eq4],t1,t2,x0,y0);   
for k in range(len(s)) :
    show(s[k]);
g=plot(line([[1,0],[0,1]],color='red'));
for k in range(len(s)) : 
    x0=s[k][2].rhs();y0=s[k][3].rhs();
    x=(1-t)^2*x1+2*t*(1-t)*x0+t^2*x2;
    y=(1-t)^2*y1+2*t*(1-t)*y0+t^2*y2;
    X=x/(x+y+1);Y=y/(x+y+1);
    g=g+parametric_plot((X,Y),(-100,100),plot_points=2000)
g 

Remark : I have had the idea to use parabolas after having seen the methodology employed in the Wikipedia article 'inellipse" mentionned by Blue with hyperbolas (IMHO, hyperbolas are less "natural" than parabolas for this issue).