Find maximum value of the following trig function

137 Views Asked by At

I am trying to fit a largest rectangle of known width (b) into a larger rectangle of known dimensions PR x PS. See the following diagram: hand written explanation of problem

I forgot to mention PS is 34.25. I came up with the following trig formula to get the maximum value of length (a), but I'm not sure how to solve for it. And perhaps there is an easier way to solve this mathematically. I did see a lot of posts on maximizing trig functions and a lot about figuring out if a rectangle can fit in another rectangle. But nothing so far to maximize one size given the width of the inner rectangle and the dimensions of the outer rectangle. Can someone help me to solve for the maximum "a" based on angle t?

1

There are 1 best solutions below

5
On BEST ANSWER

There is only one angle such that the inner rectangle touches all for sides.

So you want to maximize $a$, with

$$R\ge a\cos t+b\sin t,\\S\ge a \sin t+b\cos t.$$

Then

$$a\le \frac{R-b\sin t}{\cos t},\frac{S-b\cos t}{\sin t}.$$

If we look at the zeroes of the derivative of the left function,

$$\left(\frac{R-b\sin t}{\cos t}\right)'=\frac{R\sin t-b}{\cos^2t},$$

we have a minimum for $\sin t=\dfrac bR$. Similarly, the other minimum occurs at $\cos t=\dfrac bS$.

Finally, after simplification

$$a=\min\left(\sqrt{R^2-b^2},\sqrt{S^2-b^2}\right).$$