0001 function result = phasefunav_phi(m,x,factor);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 nj=ceil((x+1.5)*2.3);
0015 nsteps=factor*nj
0016 dteta=pi/nsteps;
0017 m1=real(m); m2=imag(m);
0018 nx=(1:nsteps);
0019 teta=(nx-0.75)*dteta; u=cos(teta); s=sin(teta);
0020 for j = 1:nsteps,
0021 a(:,j)=mie_S12(m,x,u(j));
0022 SL(j)= real(a(1,j)'*a(1,j));
0023 SR(j)= real(a(2,j)'*a(2,j));
0024 A(j)=(SL(j)+SR(j)).*s(j);
0025 end;
0026 Q=mie(m,x);
0027 Qext=Q(1); Qsca=Q(2); asy=Q(5); w=Qsca/Qext;
0028 AA=dteta*A./Qsca/x.^2;
0029
0030 L=[];
0031 for jj=1:nj,
0032 x0=legendre(jj-1,u);
0033 x=x0(1,:);
0034 L=[L,x'];
0035 gj(jj)=x*AA';
0036 gj2(jj)=gj(jj)*(2*jj-1);
0037 end;
0038 for j1=1:nsteps,
0039 for j2=1:nsteps,
0040 ab(j1,j2)=gj2.*L(j1,:)*L(j2,:)';
0041 end;
0042 end;
0043
0044 ptest=dteta*s*ab(:,1)
0045
0046 result.teta=teta;
0047 result.ab=ab;