The C++ namespace "FresnelMultiLayer" contains the class "MultiLayerStructure",which simulates
a structure of N thin films or layers,each composed of a different a material.
Every material has 3 refractive indexes (red,green,blue) ,which can be complex (n+ik),if the material is lossy (absorbing).
Between each pair of layers there is an interface.
A ray of light comes from the initial material (superstrate) with an incident angle (real number),
passes through the various layers,hitting the interfaces,and exits into the final material (substrate).
So:
N layers,N+1 interfaces,N+2 refractive indexes ( N+2 materials including intial/findl material) ,N+2 angles.
The class takes as input:
- number of layers
- array of red refractive indexes (one for every material)
- array of green refractive indexes (one for every material)
- array of blue refractive indexes (one for every material)
- array of layers thickness
and has functions to get global reflectance and transmittance,or ,in case of zero layers,the reflectance and transmittance
for the interface between initial and final material.
There are functions to get global polarized (P and S polarization ) reflectance and transmittance.
In case of lossy material (imaginary part of refractive index >0) , part of light is absorbed, so getAbsorbance() can be called.
Absorbance = 1 - Reflectance - Transmittance
In case of Total Internal Reflection (TIR), global transmittance is zero ( you'll find very small values,like 1e-16,due to rounding problems).
All of this is made following fresnel equations which compute the fraction light reflected and transmitted.
RGBFresnelValues is a structure for P & S Polarized and final values.It can be used for relectance,transmittance,absorbance for red,green,blue wavelengths.
Red,green,blue wavelengths have default values,but they can be changed calling setRGBWaveLength() function.
In this case, you must call again getReflectance/getTransmittance/getAbsorbance to to get updated values.
I have used Microsoft Visual Studio Community 2019 and the header <complex>
Read the readme.txt file for c++ functions.
Add these files to the project (file FresnelMultiLayer.cpp is the main file)
Feel free to modify everything if you want. « Less