How can I find the smallest enclosing circle for a rectangle?

12.7k Views Asked by At

I have the four vertices of a rectangle. I need to find it's smallest enclosing circle. For example:

enter image description here

I need to find the radius of the circle.

3

There are 3 best solutions below

0
On BEST ANSWER

Take half of the distance between the endpoints of a diagonal of the rectangle.

0
On

There is only one such circle for a rectangle. If your rectangle has sidelengths $a$ and $b$, then the length of the diagonal (by the Pythagorean theorem) is $\sqrt{a^2+b^2}$. Since the diagonal is a diameter, the radius is just $\dfrac{\sqrt{a^2+b^2}}{2}$.

1
On

While pythagorean theorum works well for enclosing a square with a circle and predicting the diameter, I am concerned that it does not work for a rectangle where the hypotenuse is not perpendicular to the tangent of the circle at its end points. Is this a valid concern?