When light strikes the interface between a medium with refractive index n1 and a second medium with refractive index n2, both reflection and refraction of the light may occur. These codes simulate the reflectivity occuring on the interface from the refractive index n2 at different wavelengths (suppose the first medium is air and n1 = 1).
The physics model is called Fresnel equations:
For more details, please refer to:
https://en.wikipedia.org/wiki/Fresnel_equations
The simulation results are like: