Shrinking a rectangle enscribed about another, such that it is enscribed by the other

137 Views Asked by At

I ran into this problem during my work, and I've been banging my head against it for a bit. Seems like a simple enough algebra problem, but I'm thinking it'll need to be solved numerically.

Here's the problem: say there are 2 rectangles, A and B. B is slightly smaller than A, and is rotated so that each of its vertices touches an edge of A. Now, we want to shrink A so that the reverse is true - so that each vertex of A touches an edge of B. Given the initial lengths of all the edges, what amounts, dH and dW, will need to be subtracted from the height and width of A?

Please forgive the [MS paint diagram][1]

So far, I've tried splitting the problem in two, attempting to get a function relating one enscribed rectangle to another. First, I attempt to obtain the angle between A and B as a function of their heights and widths. Then, I try to find the dimensions of A' as a function of the dimensions of B and the angle.

Again, please forgive

From this diagram, I was able to describe 5 equations that should be able to solve the problem. In the equations, Wa and Ha describe the dimensions of the outer rectangle, Wb and Hb describe the dimensions of the inner rectangle, and r is the angle between the two rectangles.

$$W_a = W_e + W_s$$ $$H_a = H_e + H_s$$ $$W_b^2 = H_s^2 + W_e^2$$ $$H_b^2 = W_s^2 + H_e^2$$ $${W_s \over H_e} = {H_s \over W_e} = \tan^2r$$

However, whatever combination I try, I cannot remove the s and e subscript terms while also isolating r, Hb or Wb.

Any help would be much appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

You can't do what you want, so you need to decide how to compromise. You can't get $B$ from $A$ if you do it accurately. The hard way to see it is to do some trig. The easy way is to imagine $A$ is very long and narrow. As you rotate it to get $B$, the narrow dimension shrinks (proportionally) a lot compared to the long dimension. Going back has the same problem. You can't have all four corners touching sides unless you change the aspect ratio of the rectangle. There are a number of questions here about inscribing rectangles in rectangles. If you search on rectangle you will probably have a reasonable density to look at.