The segments \(BC\) and \(AC\) have the same length as the square side, namely \(1\).
The angle \(\widehat{BCA}\) is \(30^\circ\), see
.
We compute the length of \(AB\) by applying the law of cosine in the triangle \(ABC\).
We have \[AB^2= 1 + 1 -2\cdot \cos(30^{\circ})=2-\sqrt{3}\]
and hence \[AB = \sqrt{2-\sqrt{3}}\,.\]