# How to find sides of rectangle that is inscribed in other rectangle?

We have smaller rectangle inscribed in the bigger rectangle as shown on the picture.

The bigger outer rectangle is inclined for a certain angle. We know height and width of the bigger rectangle and we know angle of incline. Also we know that sides ratio of the both rectangles is the same.

How to find dimentions of the inner rectangle?

• Do all four points of the small rectangle need to touch large one, or can it be only two of them as in the diagram? [If the latter there may be more than one answer] – coffeemath Apr 10 '19 at 5:12
• Is the constraint on the small rectangle to have its sides parallel to given axes ? – Jean Marie Apr 10 '19 at 5:48
• cofeemath: only two points of the small rectangle should touch the bigger one Jean Marie: the inner rectangle should be always not iclined along X and Y axes – Sergey Kravchenko Apr 10 '19 at 5:57
• I don't understand : you say you are looking for the dimensions of the inner rectangle ; but, just before, you say you know them : they are the same as the outer rectangle ? – Jean Marie Apr 10 '19 at 6:07
• Could you express your issue in terms of coordinates ? "I know the coordinates of ... I am looking for the coordinates of ..." – Jean Marie Apr 10 '19 at 6:09

I added a coordinate grid to the situation. The lengths of the red rectangle are $$a$$ and $$b$$, the angle is $$\gamma$$. I slid the blue rectangle to the left, so that it is positioned with one vertex on the origin $$(0,0)$$ as shown in the picture.
To calculate the dimensions of the blue rectangle, we want to find the coordinates of the point $$(x_0, y_0)$$. First we need to find the equation $$y=mx+q$$ for the line. We note that there is a rightangled triangle with $$\gamma$$ as an agle, such that $$\cos(\gamma)=\frac{b}{q}$$ and the slope is $$m=\tan(\gamma) .$$ We get $$y = \tan(\gamma) x + \frac{b}{\cos(\gamma)}$$ for the line. The point $$(x_0,y_0)$$ has to satisfy $$\frac{-x_0}{y_0} = \frac{a}{b}$$ and as it lies on the line, we get $$-x_0\frac{ b}{a} = \tan(\gamma) x_0 + \frac{b}{\cos(\gamma)}.$$ Rearranging results in $$x_0 =\frac{-b}{\cos(\gamma) \left(\frac{b}{a}+\tan(\gamma) \right)}$$ and $$y_0=\frac{b^2 }{a \cos(\gamma)\left(\frac{b}{a}+\tan(\gamma)\right)}.$$