function [E_theta,E_phi]=rad1(lmd,A,B,R1,R2,theta,phi)
orgin 天线位置坐标
dest 观测点
lmd=0.03;
beta=2*pi/lmd;
r=100;
{
A=[5.5*lmd,5.5*lmd];
B=[2.75*lmd,2.75*lmd];
R1=[6*lmd,6*lmd];
R2=[6*lmd,6*lmd];
r=[2,2];
theta=[pi/3,pi/3];
phi=[pi,pi];
}
%求P1,P2
u=sin(theta).*cos(phi);
v=sin(theta).*sin(phi);
s1=zeros(length(A),length(theta));
s2=s1;
t1=s1;
t2=s1;
r1=s1;
r2=s1;
cs1=s1;
cs2=s1;
ss1=s1;
ss2=s1;
ct2=s1;
st1=s1;
st2=s1;
cr1=s1;
cr2=s1;
sr1=s1;
sr2=s1;
for m=1:length(R1)
s1(m,:)=(1./(pi*beta*R1(m))).^0.5.*(-beta.*A(m)/2-beta*R1(m).*u-pi*R1(m)./A(m));
s2(m,:)=(1./(pi*beta*R1(m))).^0.5.*(beta*A(m)/2-beta*R1(m).*u-pi*R1(m)./A(m));
t1(m,:)=(1./(pi*beta*R1(m))).^0.5.*(-beta.*A(m)/2-beta*R1(m).*u+pi*R1(m)./A(m));
t2(m,:)=(1./(pi*beta*R1(m))).^0.5.*(beta.*A(m)/2-beta*R1(m).*u+pi*R1(m)./A(m));
r1(m,:)=(beta./R2(m)/pi).^0.5.*(-B(m)/2-R2(m).*v);
r2(m,:)=(beta./R2(m)/pi).^0.5.*(B(m)/2-R2(m).*v);
cs1(m,:)=mfun('FresnelC',s1(m,:));
cs2(m,:)=mfun('FresnelC',s2(m,:));
ss1(m,:)=mfun('FresnelS',s1(m,:));
ss2(m,:)=mfun('FresnelS',s2(m,:));
ct1(m,:)=mfun('FresnelC',t1(m,:));
ct2(m,:)=mfun('FresnelC',t2(m,:));
st1(m,:)=mfun('FresnelS',t1(m,:));
st2(m,:)=mfun('FresnelS',t2(m,:));
cr1(m,:)=mfun('FresnelC',r1(m,:));
cr2(m,:)=mfun('FresnelC',r2(m,:));
sr1(m,:)=mfun('FresnelS',r1(m,:));
sr2(m,:)=mfun('FresnelS',r2(m,:));
P1(m,:)=0.5*(pi*R1(m)./beta).^0.5.*(exp(1i*R1(m)/2/beta.*(beta*u+pi./A(m)).^2).*(cs2(m,:)-1i*ss2(m,:)-cs1(m,:)+1i*ss1(m,:))+...
exp(1i*R1(m)/2/beta.*(beta*u-pi./A(m)).^2).*(ct2(m,:)-1i*st2(m,:)-ct1(m,:)+1i*st1(m,:)));
P2(m,:)=(pi*R2(m)/beta).^0.5.*exp(1i*beta*R2(m)/2.*v.^2).*(cr2(m,:)-1i*sr2(m,:)-cr1(m,:)+1i*sr1(m,:));
Py(m,:)=P1(m,:).*P2(m,:);
E_theta(m,:)=1i*beta./(4*pi*r).*exp(-1i*beta.*r).*(1+cos(theta)).*sin(phi).*Py(m,:);
E_phi(m,:)=1i*beta./(4*pi*r).*exp(-1i*beta.*r).*(1+cos(theta)).*cos(phi).*Py(m,:);
end
orgin 天线位置坐标
dest 观测点
lmd=0.03;
beta=2*pi/lmd;
r=100;
{
A=[5.5*lmd,5.5*lmd];
B=[2.75*lmd,2.75*lmd];
R1=[6*lmd,6*lmd];
R2=[6*lmd,6*lmd];
r=[2,2];
theta=[pi/3,pi/3];
phi=[pi,pi];
}
%求P1,P2
u=sin(theta).*cos(phi);
v=sin(theta).*sin(phi);
s1=zeros(length(A),length(theta));
s2=s1;
t1=s1;
t2=s1;
r1=s1;
r2=s1;
cs1=s1;
cs2=s1;
ss1=s1;
ss2=s1;
ct2=s1;
st1=s1;
st2=s1;
cr1=s1;
cr2=s1;
sr1=s1;
sr2=s1;
for m=1:length(R1)
s1(m,:)=(1./(pi*beta*R1(m))).^0.5.*(-beta.*A(m)/2-beta*R1(m).*u-pi*R1(m)./A(m));
s2(m,:)=(1./(pi*beta*R1(m))).^0.5.*(beta*A(m)/2-beta*R1(m).*u-pi*R1(m)./A(m));
t1(m,:)=(1./(pi*beta*R1(m))).^0.5.*(-beta.*A(m)/2-beta*R1(m).*u+pi*R1(m)./A(m));
t2(m,:)=(1./(pi*beta*R1(m))).^0.5.*(beta.*A(m)/2-beta*R1(m).*u+pi*R1(m)./A(m));
r1(m,:)=(beta./R2(m)/pi).^0.5.*(-B(m)/2-R2(m).*v);
r2(m,:)=(beta./R2(m)/pi).^0.5.*(B(m)/2-R2(m).*v);
cs1(m,:)=mfun('FresnelC',s1(m,:));
cs2(m,:)=mfun('FresnelC',s2(m,:));
ss1(m,:)=mfun('FresnelS',s1(m,:));
ss2(m,:)=mfun('FresnelS',s2(m,:));
ct1(m,:)=mfun('FresnelC',t1(m,:));
ct2(m,:)=mfun('FresnelC',t2(m,:));
st1(m,:)=mfun('FresnelS',t1(m,:));
st2(m,:)=mfun('FresnelS',t2(m,:));
cr1(m,:)=mfun('FresnelC',r1(m,:));
cr2(m,:)=mfun('FresnelC',r2(m,:));
sr1(m,:)=mfun('FresnelS',r1(m,:));
sr2(m,:)=mfun('FresnelS',r2(m,:));
P1(m,:)=0.5*(pi*R1(m)./beta).^0.5.*(exp(1i*R1(m)/2/beta.*(beta*u+pi./A(m)).^2).*(cs2(m,:)-1i*ss2(m,:)-cs1(m,:)+1i*ss1(m,:))+...
exp(1i*R1(m)/2/beta.*(beta*u-pi./A(m)).^2).*(ct2(m,:)-1i*st2(m,:)-ct1(m,:)+1i*st1(m,:)));
P2(m,:)=(pi*R2(m)/beta).^0.5.*exp(1i*beta*R2(m)/2.*v.^2).*(cr2(m,:)-1i*sr2(m,:)-cr1(m,:)+1i*sr1(m,:));
Py(m,:)=P1(m,:).*P2(m,:);
E_theta(m,:)=1i*beta./(4*pi*r).*exp(-1i*beta.*r).*(1+cos(theta)).*sin(phi).*Py(m,:);
E_phi(m,:)=1i*beta./(4*pi*r).*exp(-1i*beta.*r).*(1+cos(theta)).*cos(phi).*Py(m,:);
end