Inscribing an ellipse in an irregular convex pentagon

240 Views Asked by At

Using the methods of projective geometry, identify the unique ellipse that is inscribed in a given convex pentagon.

Suppose the vertices of the pentagon are: $(1, 0), (4, 2), (3, 6), (-1, 5), (-1, 1)$. Find the equation of the unique inscribed ellipse that is tangent to all five sides of this convex pentagon.

enter image description here

2

There are 2 best solutions below

1
On BEST ANSWER

It's easier to find the dual conic first.

Rewrite every tangents in the form:

$$X_i x+Y_i y+1=0$$

Then $(X_i,Y_i)$ are the five points defining the dual conic:

$$ \begin{align} 0 &= \det \begin{pmatrix} X^2 & XY & Y^2 & X & Y & 1 \\ X_1^2 & X_1 Y_1 & Y_1^2 & X_1 & Y_1 & 1 \\ \vdots & & & & & \vdots \\ X_5^2 & X_5 Y_5 & Y_5^2 & X_5 & Y_5 & 1 \\ \end{pmatrix} \\ \\ &= AX^2+2HXY+BY^2+2GX+2FY+C \\ \end{align}$$

The required ellipse is

$$ \begin{align} 0 &= -\det \begin{pmatrix} 0 & x & y & 1 \\ x & A & H & G \\ y & H & B & F \\ 1 & G & F & C \\ \end{pmatrix} \\ \\ &= ax^2+2hxy+by^2+2gx+2fy+c \end{align}$$

Note that $a$ is the co-factor of entry $A$ of the $3\times 3$ block matrix, etc.

For the vertical tangent, try to let $Y_i=N$ and only the terms with highest order in $N$ survive.

See also the case of quadrilateral here.

3
On

Idea - see picture. Find five points - lines with points intersection of diagonals and $A,B,C,D,E$ give tangent points. Answer: $$\frac{-435}{764}x^2+\frac{75}{382}xy-\frac{3481}{8404}y^2+\frac{165}{191} x+\frac{421}{191}y-1=0$$

enter image description here

Solution with Python

from math import isclose
from sympy import *

a,b,c,d,h=symbols('a,b,c,d,h')

A=Point(1,0)
B=Point(4,2)
C=Point(3,6)
D=Point(-1,5)
E=Point(-1,1)

print(A,B,C,D,E)
def PE(A,B,C,D,E):
   AD = Line(A, D) 
   EB = Line(E, B)
   H = EB.intersection(AD)[0]
   CH = Line(C, H)
   EA = Line(E, A)
   J = CH.intersection(EA)[0]
   return(J)

def eq_ellipse(x,y):
  return(x*x*a+x*y*b+y*y*c+d*x+h*y-1)

Q1=PE(A,B,C,D,E)
Q2=PE(B,C,D,E,A)
Q3=PE(C,D,E,A,B)
Q4=PE(D,E,A,B,C)
Q5=PE(E,A,B,C,D)
print(Q1,Q2,Q3,Q4,Q5)
(x1,y1)=Q1
(x2,y2)=Q2
(x3,y3)=Q3
(x4,y4)=Q4
(x5,y5)=Q5
print(x1*1.,y1*1.)
print(x2*1.,y2*1.)
print(x3*1.,y3*1.)
print(x4*1.,y4*1.)
print(x5*1.,y5*1.)

#equation= x1*x1*a+x1*y1*b+c*y1*y1+d*x1+h*y1=1
eq1= eq_ellipse(x1,y1)
eq2= eq_ellipse(x2,y2)
eq3= eq_ellipse(x3,y3)
eq4= eq_ellipse(x4,y4)
eq5= eq_ellipse(x5,y5)

answ=solve([eq1,eq2,eq3,eq4,eq5],(a,b,c,d,h))
print(answ)
print('a=', a.subs(answ).n())
print('b=', b.subs(answ).n())
print('c=', c.subs(answ).n())
print('d=', d.subs(answ).n())
print('h=', h.subs(answ).n())

major=-sqrt(2*(a*h*h+c*d*d-b*d*h-(b*b-4*a*c))*(a+c+sqrt((a-c)**2+b*b)))/(b*b-4*a*c)
minor=-sqrt(2*(a*h*h+c*d*d-b*d*h-(b*b-4*a*c))*(a+c-sqrt((a-c)**2+b*b)))/(b*b-4*a*c)

major=major.subs(answ)
minor=minor.subs(answ)
print('major=', major)
print('minor=', minor)

print(major.n())
print(minor.n())

print(latex(major))
print(latex(minor))


Point2D(1, 0) Point2D(4, 2) Point2D(3, 6) Point2D(-1, 5) Point2D(-1, 1)
Point2D(1/23, 11/23) Point2D(64/31, 22/31) Point2D(128/37, 154/37) Point2D(337/271, 1507/271) Point2D(-1, 143/59)
0.0434782608695652 0.478260869565217
2.06451612903226 0.709677419354839
3.45945945945946 4.16216216216216
1.24354243542435 5.56088560885609
-1.00000000000000 2.42372881355932
{a: -435/764, b: 75/382, c: -3481/8404, d: 165/191, h: 421/191}
a= -0.569371727748691
b= 0.196335078534031
c= -0.414207520228463
d= 0.863874345549738
h= 2.20418848167539
major= 401291*sqrt(806022722925/161034466681 - 195021225*sqrt(1105729)/161034466681)/363090
minor= 401291*sqrt(195021225*sqrt(1105729)/161034466681 + 806022722925/161034466681)/363090
2.13503582316532
2.76937406008801
\frac{401291 \sqrt{\frac{806022722925}{161034466681} - \frac{195021225 \sqrt{1105729}}{161034466681}}}{363090}
\frac{401291 \sqrt{\frac{195021225 \sqrt{1105729}}{161034466681} + \frac{806022722925}{161034466681}}}{363090}