Solution (source code)

= Solution

Let $D=Z_1+Z_2+Z_3+Z_4-2\pi$ be the observed closure error. Solving the normal equations gives
$$
\boxed{\widehat\theta_i=Z_i-\frac D4,\qquad i=1,2,3.}
$$