Let's say I have a parametrized ellipse

$$x (t) = a \cos(t) \cos(r) - b \sin(t) \sin(r)$$

$$y (t) = a \cos(t) \sin(r) + b \sin(t) \cos(r)$$

Where $r$ is the rotation around the axis and $t \in [0,2\pi]$ the parameter. How would I find the $a$ and $b$ such as the ellipse is largest, area wise, inside a rectangle of $w$ width and $h$ height?

Thanks math gurus!

Update: Both ellipse and rectangle are centered on $(0,0)$. Rotation $r \in [0,\pi/2]$ is elevation from the $x$ axis.

  • $\begingroup$ Geometrically, $r$ is rotation around what axis? And given the axis, what does the angle $r$ mean with respect to that axis? $\endgroup$ – coffeemath Jun 22 '16 at 0:38
  • 2
    $\begingroup$ We are only aloud to adjust $a$, and $b$, right? Does $r$ remain constant? $\endgroup$ – Hrhm Jun 22 '16 at 1:17
  • $\begingroup$ I think that talking about the parametrization is a red herring, since this is a purely geometric problem. The question is on the correctness of the intuition that the maximizing ellipse is tangent to the rectangle at the midpoints of its sides. $\endgroup$ – Lubin Jun 22 '16 at 1:53

The maxima of $x$ and $y$ when $t$ is free are

$$\hat x=\sqrt{(a\cos(r))^2+(b\sin(r))^2},\\\hat y=\sqrt{(a\sin(r))^2+(b\cos(r))^2}.$$

We need to express that they equal $w$ and $h$, and solve for $a$ and $b$, then maximize the product.

Squaring and adding/subtracting, we get

$$a^2+b^2=w^2+h^2,\\(a^2-b^2)\cos(2r)=w^2-h^2$$ and finally, subtracting the squares

$$4a^2b^2=(w^2+h^2)^2-\left(\frac{w^2-h^2}{\cos(2r)}\right)^2,$$ which is maximum for $r=0$, the axis-aligned ellipse.

  • $\begingroup$ Those are the maxima along the axes of the ellipse, not necessarily along the $x$ and $y$ axis. $\endgroup$ – Hrhm Jun 22 '16 at 13:17
  • $\begingroup$ @Hrhm: I think you are wrong. Please elaborate. $\endgroup$ – Yves Daoust Jun 22 '16 at 13:22
  • $\begingroup$ Yep, I'm wrong, my bad $\endgroup$ – Hrhm Jun 22 '16 at 13:32
  • $\begingroup$ I am sorry, I don't get it, you skipped too many steps for my little head. Could you please add a bit more details? e.g. how did you get the x and y maxima for starters ? $\endgroup$ – jldupont Jun 22 '16 at 23:57
  • 1
    $\begingroup$ @jldupont: use $p\cos(t)+q\sin(t)=\sqrt{p^2+q^2}\cos(t-\phi)$ to get the extrema. The rest is routine work. $\endgroup$ – Yves Daoust Jun 23 '16 at 6:28

Your Answer

