# Axis dimensions of oval around inscribed rectangle

I have a rectangle of known width and height. This rectangle is inscribed in an oval.

So, to be clear, the corners of the rectangle are just touching the oval, making the oval as small as possible while still covering the rectangle.

How can I get the height and width of the the circumscribed oval?

EDIT: The oval has a curvature radius of max(rectHeight, rectWidth). Sorry, forgot to mention that before.

Here's my full problem:

I am an Android developer. I am making an animation. The goal: A box morphs into an oval while expanding and fills up the entire screen (the rectangle).

By the end of the animation, the corners of the box have a curved radius of either half of the screen's height or half the screen's width, using the one that is larger. This effectively makes the former box an oval (right?). I need that oval to expand to cover the entire screen (assume always a rectangle).

I apologize for the strange and unclear question. My solution might make the problem clearer (for myself, as well). First, I guess I actually just meant a circle, since I wanted a constant radius for my morphed box's corners. I set my morphing box's final corner radius to [pseudocode] $\sqrt{\left(\frac{\text{Screen Width}}{2}\right)^2 + \left(\frac{\text{Screen Height}}{2}\right)^2}$, where the Screen Width is the width of the inscribed rectangle. Then, the width and height of the morphed box (that finally becomes a full circle) is just twice the (corner) radius.

So, it was actually a super simple problem. I just really had to talk about it to understand what I was really trying to accomplish. Thank you for your patience with me!

• Yeah, sorry again, I am just having a really hard time explaining what I am trying to accomplish. Thank you for your patience. – Nightly Nexus Jul 28 '14 at 18:54
• It's definitely better, but what might really help is a picture. (Nothing too detailed, but enough to make your readers are visualizing what you want them to.) – Semiclassical Jul 28 '14 at 18:56

This appears to be an ill-defined problem: There's a whole family of ellipses which circumscribe (that's the word you want) a given rectangle. For example, suppose the rectangle is a square of sidelengths 2. Its corners are at $(\pm1,\pm1)$, so any ellipse of the form $$\frac{x^2}{a^2}+\frac{y^2}{b^2}=\frac{1}{a^2}+\frac{1}{b^2}$$ ($a,b$ necessarily positive) will circumscribe the square.