计算光波由光密入射到光疏介质时相位变化
Pll%O@K a;$V;3C{b& clear
**P P L#`X
]E close all
&pK0>2 +.djC3^: n1=1.45,n2=1;
EG4~[5[YgI #~Xj=M% theta=0:0.1:90;
d8Vqmrc~ km>ZhsqD a=theta*pi/180;
FqyxvL. {]Mwuqn rp=(n2*cos(a)-n1*sqrt(1-(n1/n2*sin(a)).^2))./(n2*cos(a)+n1*sqrt(1-(n1/n2*sin(a)).^2));
n\9IRuYO Pjq'c+4.yL rs=(n1*cos(a)-n2*sqrt(1-(n1/n2*sin(a)).^2))./(n1*cos(a)+n2*sqrt(1-(n1/n2*sin(a)).^2));
JQb{?C ~v&Q\>' tp=2*n1*cos(a)./(n2*cos(a)+n1*sqrt(1-(n1/n2*sin(a)).^2));
4UbqYl3|a P^o@x,V!& ts=2*n1*cos(a)./(n1*cos(a)+n2*sqrt(1-(n1/n2*sin(a)).^2));
jR\pYRK 5[2kk5, arp=angle(rp);
;(mNjxA p` ~=v4;b ars=angle(rs);
)h ,v(Rxa 6b*xhu\ atp=angle(tp);
&fRz6Hd z81dm ats=angle(ts);
i&(1<S>P FVNTE+LW figure(1)
JCxQENsVqB _G)A$6weU subplot(1,2,1);
!0pK8k&MG 7cV
G?Wr plot(theta,arp,'-',theta,ars,'--','LineWidth',2)
%,$xmoj9O] V+D <626o legend('arg(r_p)','arg(r_s)')
o(}%b8 K T5`ML'Dej xlabel('\theta_i')
nh7_
jEX XX-(>B0L ylabel('\phi')
`JV(ae0 |t"CH'KJZ title(['n_1=',num2str(n1),',n_2=',num2str(n2)])
+DQUL|\ h[Sd3Z* axis([0 90 -3.5 3.5])
X<_HQ XR VZU~ZV grid on
`]]5!U2 6yYjZ< subplot(1,2,2);
NxA4*_|H9 *Mg@j;+5s plot(theta,atp,'-',theta,ats,'--','LineWidth',2)
S~r75] " [$K8y&\L legend('arg(t_p)','arg(t_s)')
(z;lNl(*C 1mHS -oI9J xlabel('\theta_i')
iN[6}V6Sm Zs|Ga,T ylabel('\phi')
Rkg)yme!N k)z>9z%D title(['n_1=',num2str(n1),',n_2=',num2str(n2)])
*Dq ++ aZo}Ix:/ axis([0 90 -3.5 3.5])
k:7Gb7\ bD/ZKvg grid on
PN99 R]K0g a
Z)1S X`D