

clear all;
close all;

%sigma = 58.108e6;   % med
sigma = 16.6e6;    % zinek

Er = 1;
freq = 30e6;
lambda = 3e8/freq

phi = 100;


Ekr = Er - lambda*sigma*60i

    
a = sin((180/pi)*phi)
b =  sqrt(Ekr - cos((180/pi)*phi)*cos((180/pi)*phi))

i=1;
for k = 0:0.1:90
    phi = (pi/180)*k;
    a = sin(phi)
    b =  sqrt(Ekr - cos(phi)^2)
    
    Rh(i) = (a-b)/(a+b);
    Rv(i) = (Ekr*a-b)/(Ekr*a+b);
   

   
    i = i+1;
end


Xplot = 0:0.1:90;

figure(1)
subplot(2,1,1)
plot(Xplot, (180/pi)*angle(Rh), 'r','LineWidth',2)
set(gcf, 'color', [1 1 1])
set(gca,'FontSize',20)
title('Fáze [°]');
xlabel('Úhel dopadu vlny [°]');
ylabel('Fáze [°]');
set(gca,'FontSize',20)

ylim([-30 210])
hold on;
plot(Xplot, (180/pi)*angle(Rv), '--b','LineWidth',2)
set(gca,'FontSize',20)
legend('Rh', 'Rv');


subplot(2,1,2)
plot(Xplot, abs(Rh), 'r','LineWidth',2)
set(gcf, 'color', [1 1 1])
set(gca,'FontSize',20)
title('Amplituda [-]')
hold on;
plot(Xplot, abs(Rv), '--b','LineWidth',2)
set(gca,'FontSize',20)
xlabel('Úhel dopadu vlny [°]');
ylabel('Amplituda [-]');
legend('Rh', 'Rv ');




