%Variation of reflectivity of dielectric film with its optical thickness
zeta_0=0;
zeta=zeta_0;
n_0=1;n_g=1.5;
lamda=632.8*1e-9; %wavelength:632.8nm
h=0:1e-9:lamda;
%n=[1.0 1.2 1.4 1.5 1.7 2.0 3.0];
n_1=1.0;n_2=1.2;n_3=1.4;n_4=1.5;n_5=1.7;n_6=2.0;n_7=3.0;
%n_1
delta_1=4*pi/lamda.*n_1.*h*cos(zeta);
R_1=((n_0-n_g)^2.*cos(delta_1./2).^2+(n_0*n_g./n_1-n_1).^2.*sin(delta_1./2).^2)./((n_0+n_g)^2.*cos(delta_1./2).^2+(n_0*n_g./n_1+n_1).^2.*sin(delta_1./2).^2);
plot(n_1*h,R_1)
hold on
%n_2
delta_2=4*pi/lamda.*n_2.*h*cos(zeta);
R_2=((n_0-n_g)^2.*cos(delta_2./2).^2+(n_0*n_g./n_2-n_2).^2.*sin(delta_2./2).^2)./((n_0+n_g)^2.*cos(delta_2./2).^2+(n_0*n_g./n_2+n_2).^2.*sin(delta_2./2).^2);
plot(n_2*h,R_2)
hold on
%n_3
delta_3=4*pi/lamda.*n_3.*h*cos(zeta);
R_3=((n_0-n_g)^2.*cos(delta_3./2).^2+(n_0*n_g./n_3-n_3).^2.*sin(delta_3./2).^2)./((n_0+n_g)^2.*cos(delta_3./2).^2+(n_0*n_g./n_3+n_3).^2.*sin(delta_3./2).^2);
plot(n_3*h,R_3)
hold on
%n_5
delta_5=4*pi/lamda.*n_5.*h*cos(zeta);
R_5=((n_0-n_g)^2.*cos(delta_5./2).^2+(n_0*n_g./n_5-n_5).^2.*sin(delta_5./2).^2)./((n_0+n_g)^2.*cos(delta_5./2).^2+(n_0*n_g./n_5+n_5).^2.*sin(delta_5./2).^2);
plot(n_5*h,R_5)
hold on
%n_6
delta_6=4*pi/lamda.*n_6.*h*cos(zeta);
R_6=((n_0-n_g)^2.*cos(delta_6./2).^2+(n_0*n_g./n_6-n_6).^2.*sin(delta_6./2).^2)./((n_0+n_g)^2.*cos(delta_6./2).^2+(n_0*n_g./n_6+n_6).^2.*sin(delta_6./2).^2);
plot(n_6*h,R_6)
hold on
%n_7
delta_7=4*pi/lamda.*n_7.*h*cos(zeta);
R_7=((n_0-n_g)^2.*cos(delta_7./2).^2+(n_0*n_g./n_7-n_7).^2.*sin(delta_7./2).^2)./((n_0+n_g)^2.*cos(delta_7./2).^2+(n_0*n_g./n_7+n_7).^2.*sin(delta_7./2).^2);
plot(n_7*h,R_7)
xlabel('nh')
ylabel('R')