1. ## [SOLVED] Radius of a rounded corner rectangle

Is there anyone who knows the equation to find the radius of a rounded corner rectangle? My givens are: Length, Width and Diagonal.

2. Post the ORIGINAL problem IN FULL.

3. That is the question in full. Okay, I'll actually put a problem to it...

Say I have a round cornered rectangle with a length of 4 in, a width of 3 in and a diagonal of 4.5 in. How would I find the Radius of the rounded corner?

4. Originally Posted by forgottenEmbers
Say I have a round cornered rectangle with a length of 4 in, a width of 3 in and a diagonal of 4.5 in.
How would I find the Radius of the rounded corner?
WHAT forms your length of 4: the lenth of the original rectangle,
before the corners were rounded off?
WHAT forms your width of 3: the width of the original rectangle,
before the corners were rounded off?
Is your diagonal of 4.5 intended to be the diagonal of a 3 by 4 rectangle?
If so, NOT possible: the diagonal equals 5.

Is your question intended to be:
we have a rectangle, size 3 by 4, thus a diagonal of 5.
The corners are rounded off, shortening the diagonal line to 4.5
What is the radius of the circle used to form the rounded corners?

"area of rectangle with rounded corners".

NOTE: (W = rectangle's width) any circle of radius >0 and <W/2 can be used to form the rounded corners.
As example, using rectangle length=100 and width=80, 39 circles of radius 1 to 39 can be used.
Radius 40, if used, results in the rectangle's ends being semicircles.

Thank you for taking time to help me with this. Sorry for not making my query clear.

The length and width of the rectangle ARE the measurements of the original rectangle (before the edges are rounded).

The diagonal is the measurement from rounded corner to rounded corner. A standard 3, 4, 5, when the corners are rounded will shrink the diagonal which is why I said it is now a 3, 4, 4 1/2.

I found a flash calculator that does exactly what I'm looking for, and should explain better what I'm asking (see link below) however, it's not enough being able to solve it, I need the equation. As to your google comment, I have searched all over, to the point patience allows and all come up with are tricks for making rounded corners in stylesheets.

I hope this calculator explains my needs better than my words.

*Note: For some reason this flash will not work with Firefox or Chrome, but does work with IE.

6. I'm assuming that the picture ought to look like this:

The first difficulty is to know how you are going to measure the diagonal distance d between the rounded corners. I'm assuming that you take the diagonal of the full rectangle, as in the picture, and measure that part of it that lies between the quarter-circles at each end.

The diagonal of the full rectangle is $\displaystyle \sqrt{l^2+w^2}$ (by Pythagoras). If we denote by x the little bit that is trimmed off each end of the diagonal when the corners are rounded, then $\displaystyle x = \tfrac12\bigl(\sqrt{l^2+w^2}-d\bigr)$. So we need to calculate x in terms of r, the radius of the rounded corners.

That turned out to be harder than I was expecting. The difficulty is that, as you can see in the picture, the diagonal does not pass through the top left vertex of that little square of side r (except when the rectangle is a square). If I haven't made mistakes, then the formula for x is $\displaystyle x = \frac{r\bigl(l+w-\sqrt{2lw}\bigr)}{\sqrt{l^2+w^2}}$.

Finally, if you put those two formulas for x together, and solve for r, you should get $\displaystyle \boxed{r = \frac{l^2+w^2 - d\sqrt{l^2+w^2}}{2\bigl(l+w-\sqrt{2lw}\bigr)}}$.

When l = 4in, w = 3in and d = 4.5in, that gives $\displaystyle r\approx0.595$in.

7. Opalg:
That's what I've been looking for. I ran the formula through my test program and it came up 10 for 10. Thank you for all your help.

8. Originally Posted by forgottenEmbers
As to your google comment, I have searched all over, to the point patience allows and all come up with are tricks for making rounded corners in stylesheets.
Ya...just had a try at it...not much help fer sure; Mathworld has a little:
Rounded Rectangle -- from Wolfram MathWorld

Nice one, Opal

,

,

,

,

,

,

,

,

,

,

,

,

,