[ Rectangles and Squares. Properties and Characteristics ]

Right triangle $A B C\left(\angle A=90^{\circ}\right)$ and two squares $B E F C$ and $A M N C$ are positioned such that points $E$ and $A$ lie on opposite sides of line $B C$, and points $M$ and $B$ lie on the same side of line $A C$. Find the distance between the centers of the squares, if $A B=a$.
Let $P$ and $Q$ be the centers of two squares. Prove that points $A, P$, and $Q$ lie on the same line.

## Solution

Consider the case when $AB > AC$. Let $P$ be the center of the square $B E F C$. Denote $AC = b$. Let $X$ be the projection of point $F$ onto line $AC$, $Y$ be the projection of point $E$ onto line $AB$, and $Z$ be the intersection point of lines $FX$ and $EY$. Then $AXZY$ is a square with side length $a + b$, and $P$ is its center. Therefore, $\angle CAP = 45^\circ$.

Let $Q$ be the center of the second square. Then $\angle CAQ = 45^\circ$. Therefore, points $A, Q$, and $P$ lie on the same line, and in this case, point $Q$ lies between points $A$ and $P$. Consequently,

$QP = AP - AQ = \frac{a + b}{\sqrt{2}} - \frac{b}{\sqrt{2}} = \frac{a}{\sqrt{2}}$.

## Answer

$\frac{a}{\sqrt{2}}$.