(require 'fresnel-equations)
Layers with negative thickness are modeled as incoherent (with positive thickness); otherwise as coherent (with inteference fringing).
The index-of-refraction of the top and bottom media are given by the first and last layers, which must have thickness 0. w is probe wavelength. th_i is the angle of the incident ray in radians.
Combine-layers returns a list of three non-negative real
numbers:
The transmitted and forward ratios sum to 1.0 if layers are all dielectric (lossless). The transmitted and reverse ratios sum to 1.0 if layers are all dielectric (lossless).
Negative w computes the S-polarization, else the P-polarization.
snell-law returns the exit angle (from normal) of an incident
ray impinging at th-i from normal. If the ray undergoes total
internal reflection, then the returned angle will not be real and
should be ignored.
(snell-law 2.8 1.3 .1) => 216.71826868463917e-3 (snell-law 2.8 1.3 .3) => 689.9583515921762e-3 (snell-law 2.8 1.3 .4) => 994.9783891781343e-3 (snell-law 2.8 1.3 .5) => 1.5707963267948965-254.68865153727376e-3i
snells-law returns the exit angle (from normal) of an incident
ray impinging at th-i from normal. If the ray undergoes total
internal reflection, then the returned angle is bogus and should be
ignored.