# How do I find the size of a non-proportional rectangle inside a given ellipse?

I understand how to calculate the largest possible rectangle that can be drawn inside an ellipse, but my problem is: I a have a rectangle of given proportions and an ellipse of a given size (not the same proportions) and I need to know how big that rectangle will be when centered inside the ellipse and sized with all four corners intersecting.

## Answers

If the rectangle is centered inside the ellipse, and for all 4 corners to lie on the ellipse, the 4 corners must be the solution to the equation system of:

**[1]** implicit equation of the ellipse: x^2/a^2 + y^2/b^2 = 1

**[2]** The proportion of the rectangle (aspect ratio) x / y = c.

Just substitute in and solve the equation for x and y. 2 * abs(x) will be the width and 2 * abs(y) will be the height of the rectangle.