Home

Introduction

Contents

Scripts

FeedBack

Date 08/09/2010
Script S1_2_21.m
Download Script S1_2_21.m
%==============================================
%Fresnel formulae
%==============================================
%
%refractive index of the transparent medium
n=1.6;
%N number of angles of incidence in radians
N=200;
%between 0 and pi/2
teta1=linspace(eps,pi/2,N);
%and in degrees
teta1_g=teta1*(180/pi);
%the sine of the angle of refraction sinteta2 = sen(teta2)=(1/n)*sen(teta1)
sinteta2=(1/n).*(sin(teta1));
%magnitudes Epw and Epy using the Fresne formulae
%of the components of the electric field associated to the reflected ray
teta2=asin(sinteta2);
diff=teta1-teta2;
sum=teta1+teta2;
Epw=tan(diff)./tan(sum);
Epy=-sin(diff)./sin(sum);
i=1;
%when Epw changes sign
while Epw(i)>0
i=i+1;
end
%i defines the first element of the array greater than zero
i
E1zero=Epw(i)
%i-1 defines the last negative element of the array
E2zero=Epw(i-1)
%the corresponding values of the angle of incidence
teta1zero=teta1_g(i)
teta2zero=teta1_g(i-1)
%the angle alfa (radian) or alfa_g (degree)
%between Ep and w axis on the plane wy
arg=Epy./Epw;
alfa=atan(arg);
alfa_g=alfa*(180/pi);
%the right orientation of the electric field associated to
%the reflected ray
for j=i:N
alfa_g(j)=alfa_g(j)-180;
end
alfa_g
%the magnitude Ep of the electric field associated to the reflected ray
rad1=Epy.^2;
rad2=Epw.^2;
Ep=sqrt(rad1+rad2);
%*****************************************
plot(teta1_g,Epw,'r-',teta1_g,Epy,'b-'),
grid on,title('n=1.6, red for Epw, blue for Epy'),figure
plot(teta1_g,alfa_g,'r-')
grid on,
title('angle between Ep and w axis on the plane wy varying angle of incidence')
figure
plot(teta1_g,Ep,'b-')
grid on,
title('n=1.6, magnitude of Ep varying angle of incidence')
%==============================================
%
Top