It is calculated by taking the product of the geometric length of the optical path followed by light and the refractive index of the homogeneous medium through which the light ray propagates; for inhomogeneous optical media, the product above is generalized as a path integral as part of the ray tracing procedure.
Finally, using the phase change, the interference between the two waves can be calculated.
The OPD corresponds to the phase shift undergone by the light emitted from two previously coherent sources when passed through mediums of different refractive indices.
This is because a larger number of wavelengths fit in the same distance due to the higher refractive index of the glass.
The OPD can be calculated from the following equation: where d1 and d2 are the distances of the ray passing through medium 1 or 2, n1 is the greater refractive index (e.g., glass) and n2 is the smaller refractive index (e.g., air).