Trigonometric rule on a spherical square Consider a square on a sphere (in three dimensions), with edges of length $a$ and angles $\beta$. I want to prove the following formula:
$$
\cos(a) = \cot^2(\beta /2) = \frac{1 + \cos(\beta)}{1 - \cos(\beta)},
$$
but I have no idea how to do this, and which (spherical) rules I can use.

Given a spherical square whose side length is $a$ and vertex angle is $ \beta$. Draw one of the diagonals (this diagonal will bisect the vertex angles) & call the length of this diagonal $x$, this will split the square into two isoceles triangles. Consider one of these trianlges, it will have lengths $a,a,x$ and opposite angles $\beta/2, \beta/2, \beta$ respectively. By the sine rule we have
\begin{eqnarray*}
\frac{\sin(x)}{\sin(\beta)} =\frac{\sin(a)}{\sin(\frac{\beta}{2})}   \\
\sin(x) = 2 \sin(a) \cos(\frac{\beta}{2}).
 \end{eqnarray*}
Now apply the cosine rule (using the diagonal as the base)
\begin{eqnarray*}
\cos(x)=\cos^2(a)+\sin^2(a) \cos(\beta) \\
\cos(x)=1-2\sin^2(a) \sin(\frac{\beta}{2}).
\end{eqnarray*}
Square the above equation & Pythagorus ... we have
\begin{eqnarray*}
\sin^2(x)=4 \sin^2(a) \sin^2(\frac{\beta}{2})(1-\sin^2(a) \sin^2(\frac{\beta}{2})).
\end{eqnarray*}
From the sin rule we can eliminate $x$ ... we have
\begin{eqnarray*}
\cos^2(\frac{\beta}{2})= \sin^2(\frac{\beta}{2})(1-\sin^2(a) \sin^2(\frac{\beta}{2})) \\
\sin(a)=\frac{-\cos(\beta)}{\sin^4(\frac{\beta}{2})}=\frac{-4 \cos(\beta)}{(1-\cos(\beta))^2}
\end{eqnarray*}
Now pythagorus, square root & we are done
\begin{eqnarray*}
\color{red}{\sin(a)=\frac{1+\cos(\beta)}{1-\cos(\beta)}} = \color{blue}{\cot \left( \frac{\beta}{2} \right)}.
\end{eqnarray*}
Perhaps the nicest example of a square project onto the surface of a sphere is a cube ...

REF WIKI : https://en.wikipedia.org/wiki/Cube#Spherical_tiling 
In this case the vertex angle is $\beta =\frac{ 2 \pi}{3}$ and the edge length angle is $a=\cos^{-1}(\frac{1}{3})$.
