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!

  • $\begingroup$ Yeah, sorry again, I am just having a really hard time explaining what I am trying to accomplish. Thank you for your patience. $\endgroup$ – Nightly Nexus Jul 28 '14 at 18:54
  • $\begingroup$ 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.) $\endgroup$ – Semiclassical Jul 28 '14 at 18:56

Note: This was for the original statement of the problem. I'll leave it like this until I can appreciate the new version.

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.

See Wolfram Alpha for illustrative examples.

  • $\begingroup$ Oh, very true. Thanks. How about my updated problem? Let me know if the edit makes any sense. $\endgroup$ – Nightly Nexus Jul 28 '14 at 18:38
  • $\begingroup$ It's a little strange. Try saying it in words? @NightlyNexus $\endgroup$ – Semiclassical Jul 28 '14 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.