Solution (source code)

= Solution

Adding a known phase $\pi/2$ in the same arm changes the observed phase to $\phi+\pi/2$. Combining measurements with and without that extra plate determines both quadratures. Explicitly, $p_1-p_2=\cos\phi$ and $p_1^{(\pi/2)}-p_2^{(\pi/2)}=\cos(\phi+\pi/2)=-\sin\phi$. Hence the ordered pair determines $\phi$ modulo $2\pi$, removing the sign ambiguity of a cosine alone.

It still leaves the integer fringe order undetermined:
$$
\boxed{d=\frac{\lambda}{2\pi(n-1)}\bigl(\phi_{\rm mod\,2\pi}+2\pi m\bigr),\qquad m\in\mathbb Z,\quad d\geq0.}
$$
Thus the thickness remains periodic with period $\lambda/(n-1)$. A known thickness interval shorter than this period, a suitable multiple-<wavelength> measurement, or continuous phase tracking supplies the missing information. If $n$ is unknown, a single <wavelength> only determines the excess optical thickness $(n-1)d$ modulo $\lambda$.