0001 function result = mie_phasefunasy(m, x, nsteps)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 dteta=pi/(nsteps-1);
0014 m1=real(m); m2=imag(m);
0015 nx=(1:nsteps);
0016 teta=(nx-1).*dteta;
0017 for j = 1:nsteps,
0018 u=cos(teta(j));
0019 a(:,j)=mie_S12(m,x,u);
0020 SL(j)= real(a(1,j)'*a(1,j));
0021 SR(j)= real(a(2,j)'*a(2,j));
0022 end;
0023 tetad=teta*180/pi;
0024 co=cos(teta);
0025 dcos=-diff(co);
0026 Q=mie(m,x);
0027 Qext=Q(1); Qsca=Q(2); asy=Q(5); w=Qsca/Qext;
0028 p=co.*(2*(SL+SR)./Qsca/x.^2);
0029 n=length(teta);
0030 p1=p(1:n-1); p2=p(2:n); p3=0.5*(p1+p2);
0031 dasy=[0,cumsum(0.5*dcos.*p3)];
0032
0033 plot(tetad(1:n),dasy,'r-')
0034 title(sprintf('m=%g+%gi, x=%g, w=%g, g=%g',m1,m2,x,w,asy))
0035 xlabel('Scattering Angle (deg)'),ylabel('dasy')