Optical path length
In optics, optical path length (OPL) or optical distance is the product of the geometric length of the path light follows through the system, and the index of refraction of the medium through which it propagates. A difference in optical path length between two paths is often called the optical path difference (OPD). Optical path length is important because it determines the phase of the light and governs interference and diffraction of light as it propagates.
Optical Path Difference (OPD) 
Optical path difference is the phase shift which happens between two previously coherent sources when passed through different mediums. For example a wave passed through glass will appear to travel a greater distance than an identical wave in air. This is because the source in the glass will have experienced a greater number of wavelengths 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 greater refractive index (e.g., glass) and n2 is the smaller refractive index (e.g., air).
Mathematical derivation 
n=c/v=γ/γ° where c-speed of light in vacuum, v -speed of light in medium,γ-wavelength in vacuum,γ°-wavelength in medium similarly n=d/d° d-distance traveled by light in vacuum in time t,d°-distance traveled by light in medium in time t
multiply both side by d° hence d=n*d° is the optical path
In a medium of constant refractive index, n, the OPL for a path of physical length d is just
If the refractive index varies along the path, the OPL is given by
where n(s) is the local refractive index as a function of distance, s, along the path C.
An electromagnetic wave that travels a path of given optical path length arrives with the same phase shift as if it had traveled a path of that physical length in a vacuum. Thus, if a wave is traveling through several different media, then the optical path length of each medium can be added to find the total optical path length. The optical path difference between the paths taken by two identical waves can then be used to find the phase change. Finally, using the phase change, the interference between the two waves can be calculated.
Fermat's principle states that the path light takes between two points is the path that has the minimum optical path length.