Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Math problem: Determine the corner radius of an inner border based on outer corner radius/thickness

Here's a math/geometry problem for the math whizzes (not my strongest subject). This is for WPF, but should be general enough to solve regardless:

I have two embedded Border elements, with the outer one having a certain corner radius, R and border thickness, T. Given these two values, what should the corner radius of the inner Border, R' be set to such that the two corner edges meet with no overlap or holes?

alt text

So far I've just been eyeballing it, but if someone can give me a proper formula that would be great. Respect points if you can!! ;)

like image 486
devios1 Avatar asked May 28 '10 20:05

devios1


1 Answers

T'/2 + R` = R - T/2

or

For a given T, R and T' then R' = R - T/2 - T'/2

So for instance for an outer border thickness of (T=10), and radius of (R=8), and an inner border thickness of (T'=4), you'd need an inner border radius of 1.

like image 118
Aviad P. Avatar answered Oct 05 '22 23:10

Aviad P.