0
$\begingroup$

First of all, sorry if the english isn't perfect, not my main language.

I guess this problem is easy to solve but I am too dumb for that... :(

We have two rectangle side by side. We rotate them both from their center, same angle. Once we have done that, the two rectangles are partly on top of each other. What is the translation value to apply to the rectangle on the right so its left edge is "side by side" with the right edge of the rectangle on the left ?

And because it is hard to visualize, here comes two screenshots :

Before : Initial Position After: Position After Rotation What is the function that allows to translate (only horizontally) the right one in a way that its left side is on top of the right side of the rectangle on the left ,depending of the rotation angle ?

1 Answers 1

0

Suppose that the distance between the rectangle centers is $w$. In your case, $w$ is about $15 - 4.5 = 11.5$. Let's suppose that we rotate by angle $t$. Then the distance needed to "align" the two rotated rectangles is $$ d = w \left( \frac{1}{\cos t} - 1 \right). $$

When $t = 0$ (i.e., the rectangles aren't rotated at all), that gives you $d = 0$, which is right. When the rotation is 90 degrees, it gives you infinity, which is also correct. So at least a quick sanity-check suggests I've got the right formula.

  • 0
    Thank you so much ! It worked. Have a great day !2017-01-11