Propagation and reflection phases (source code)

= Propagation and reflection phases

Let the first ray reflect at the upper surface and the second traverse the film, reflect below, and emerge at a laterally displaced point. Its internal round-trip geometric length is $2d/\cos\theta$, but the external path to a common outgoing <wavefront> must also be included. The lateral separation is $2d\tan\theta$, whose projection along the external ray is $2d\tan\theta\sin\theta_i$. The net <optical path difference> is therefore
$$
\Delta\ell=\frac{2nd}{\cos\theta}-2d\tan\theta\sin\theta_i
=\frac{2nd(1-\sin^2\theta)}{\cos\theta}=2nd\cos\theta,
$$
using <Snell's law> $\sin\theta_i=n\sin\theta$. Multiplying by the vacuum <wavenumber> gives
$$
\boxed{\delta=\frac{4\pi nd}{\lambda}\cos\theta}.
$$
For the usual index ordering $1<n<n_2$, including the stated later value $n=1.2$, both reflections are towards higher <refractive index> and both reverse the electric-field sign. Their relative reflection <phase> is therefore zero; $\delta$ is also their total relative <phase> modulo $2\pi$. A different index ordering or polarization-dependent reflection <phase> would require that additional term.