Finding the length of the side of the equilateral triangle 
Here, ABCD is a rectangle, and BC = 3 cm. An Equilateral triangle XYZ is inscribed inside the rectangle as shown in the figure where YE = 2 cm. YE is perpendicular to DC. Calculate the length of the side of the equilateral triangle XYZ.
 A: Consider the reference system with the origin in $Z$ in which $DC$ is the real axis, and let $EZ=a$. Then we have $Y=a+2i$ and:
$$e^{\pi i/6}(a+2i) = X $$
so:
$$\Im \left[\left(\frac{1}{2}+\frac{\sqrt{3}}{2}i\right)\cdot\left(a+2i\right)\right]=3, $$
or:
$$ 1+\frac{\sqrt{3}}{2}a = 3 $$
so $a = \frac{4}{\sqrt{3}}$, and by the Pythagorean theorem:
$$ ZY^2 = a^2 + 4 = \frac{16}{3}+4 = \frac{28}{3} $$
so the side length is $2\sqrt{\frac{7}{3}}$.
A: Hint:  Extend $EY$ to meet $AB$ at $F$.  Drop a vertical line from $X$, hitting $CD$ at $G$.   You now have three right triangles with the hypotenuse being the side of the equilateral triangle.
A: 
Let $|XY|=|YZ|=|ZX|=a$,
$\angle EYZ=\theta$, $|FY|=1$.
Then $\angle XYF=120^\circ-\theta$,
\begin{align}
\triangle EYZ:\quad
a\cos\theta&=2
\tag{1}\label{1}
,\\
\triangle FXY:\quad
a\cos(120^\circ-\theta)&=1
\tag{2}\label{2}
,
\end{align} 
\begin{align} 
a\cos(120^\circ-\theta)&=
\frac {a\sqrt3}2\,\sin\theta
-\frac a2\cos\theta
\\
&=
\frac {a\sqrt3}2\,\sin\theta
-1
,
\end{align} 
so the system \eqref{1},\eqref{2}
changes to
\begin{align}
a\cos\theta&=2
\tag{3}\label{3}
,\\
a\,\sin\theta
&=\frac{4\sqrt3}3
\tag{4}\label{4}
,
\end{align} 
which can be easily solved for $a$:
\begin{align}
a^2\cos^2\theta+
a^2\sin^2\theta
&=2^2+\left(\frac{4\sqrt3}3\right)^2
,\\
a^2&=\frac {28}3
,\\
a&=\frac 23\,\sqrt{21}
.
\end{align}
