Fitting a largest area ellipse into a rectangle

conic sectionsgeometry

Given: a rectangle with vertices

$A(0,2), B(0.5, 2.5), C(2.5, -0.5)$ and $D(3,0)$.

How to find the largest ellipse that can fit inside this rectangle?I'm confused about this rotational angle that I need to find. I know that the procedure is like the one here https://xaktly.com/Ellipse.html but not sure about angle.

Best Answer

Let $OA$ and $OB$ be the semiaxes of the inscribed ellipse (see figure). The area of the ellipse is then:

$$\text{area}(\text{ellipse})=\pi\,OA\cdot OB.$$

If $T$ is a tangency point on side $QR$ of the rectangle, and $OG$ (parallel to $QR$) is the semidiameter conjugated to $OT$, then we know by Apollonius's theorem that: $$ OA\cdot OB=2\,\text{area}(TOG)=2\,\text{area}(LOG)=OL\cdot OG, $$ where $L$ is the midpoint of side $QR$. Hence:

$$\text{area}(\text{ellipse})=\pi\,OL\cdot OG.$$

As $OL$ is fixed, that area reaches its maximum when $OG$ is maximum, that is when $G$ is the midpoint of side $RS$. It follows that the inscribed ellipse with largest area is the one touching the sides of the rectangle at their midpoints.

enter image description here

EDIT.

To find the equation of this ellipse in your case, note first of all that its centre is $O=(1.5, 1)$ and its axes form an angle of $45°$ with coordinate axes, which implies $x\leftrightarrow y$ symmetry if centred at the origin. Hence the equation of the ellipse must be of the form: $$ \alpha(x-1.5)^2+\alpha(y-1)^2+\beta(x-1.5)(y-1)=1, $$ where $\alpha$ and $\beta$ are two constants, which can be easily found by plugging into the equation the coordinates of two tangency points, for instance $(0.25, 2.25)$ and $(1.75,1.25)$.