In a corner stand, there are three shelves measuring $30 \mathrm{~cm} \times 40 \mathrm{~cm}$, and the distance between adjacent shelves is equal. Where the two walls and the middle shelf meet, three spiders have made their nests. Once, one of them climbed diagonally up one wall to the corner of the top shelf, another crawled diagonally down the other wall to the corner of the bottom shelf. The third spider remained in place and observed that its companions appeared at an angle of $120^{\circ}$. What is the distance between the shelves? (The adjacent shelves are the same distance apart.)
Solution. Let the edges of the lowest shelf be $a$ and $b$, the diagonal of the rectangle be $e$, and the distance between the shelves be $x$. The positions of the two spiders are points $E$ and $F$, with $E F=h, F G=f, E G=g$. The third spider observes the other two from point $G$, and $\angle F G E = 120^{\circ}$.

![](https://cdn.mathpix.com/cropped/2024_05_02_8b74a14598b2a099041ag-1.jpg?height=458&width=504&top_left_y=270&top_left_x=802)

We apply the Pythagorean theorem to the resulting right triangles:

$$
\begin{aligned}
a^{2}+b^{2} & =e^{2} \\
e^{2}+(2 x)^{2} & =h^{2} \\
b^{2}+x^{2} & =g^{2} \\
a^{2}+x^{2} & =f^{2}
\end{aligned}
$$

In the triangle $F G E$, the cosine rule for side $h$ is:

$$
h^{2}=f^{2}+g^{2}-2 f g \cdot \cos 120^{\circ}
$$

Substitute the expressions for $e, f, g, h$ from the previously written Pythagorean theorems, as well as the value $\cos 120^{\circ}=-\frac{1}{2}$:

$$
a^{2}+b^{2}+4 x^{2}=a^{2}+x^{2}+b^{2}+x^{2}+\sqrt{\left(a^{2}+x^{2}\right)\left(b^{2}+x^{2}\right)}
$$

Perform the indicated operations; after squaring and rearranging, we get:

$$
3 x^{4}-\left(a^{2}+b^{2}\right) x^{2}-a^{2} b^{2}=0, \quad \text { where } \quad a=30, b=40
$$

After substitution, we arrive at the following fourth-degree equation:

$$
3 x^{4}-2500 x^{2}-1440000=0
$$

From here, $x \approx \sqrt{1225.13}$ is the positive root of the equation. The distance between the shelves is $x \approx 35 \text{ cm}$.