DIFFR1 Physical basis of diffraction.
Electric field as function of x and z.
by Chuck DiMarzio Northeastern University 2010
!! This file may be copied, used, or modified for educational and !! research purposes provided that this header information is not !! removed or altered, and provided that the book is cited in !! publications, as DiMarzio, Charles A., Optics for Engineers, !! CRC Press, Boca Raton, FL, 2011. !! http://www.crcpress.com !! Other distribution is prohibited without permission.
Contents
Start
stepx=0.5;stepz=0.2; xaxis=[-1:stepx:1]; zaxis=[0:stepz:3]; [x,z]=meshgrid(xaxis,zaxis); nulls=zeros(size(z)); field=zeros(size(x)); use=[floor(length(xaxis)/4):floor(length(xaxis)*3/4)]; field(:,use)=cos(2*pi*0.5*z(:,use)); fig1=figure;quiver3(x,z,nulls,nulls,nulls,field,'k'); hold on;plot3(x,z,nulls,'m--'); xlabel('y');ylabel('z');zlabel('x'); fz=[0,0,0,0,0]; % five zeros for boxes f1=[1,1,1,1,1]; % five ones for boxes plot3(xaxis([3,4,4,3,3])+0.03*stepx*[1,-1,-1,1,1],... fz,0.2*[0,0,1,1,0],'b--'); plot3(xaxis([1,2,2,1,1])+0.03*stepx*[1,-1,-1,1,1],... fz,... 0.2*[0,0,1,1,0],'b-'); plot3(xaxis(2)*f1,... zaxis([1,2,2,1,1])+0.03*stepz*[1,-1,-1,1,1],... 0.2*[0,0,1,1,0]+0.03*stepx*[1,1,-1,-1,1],'r-'); plot3(xaxis([1,2,2,1,1]),... zaxis([1,1,2,2,1]),... 0.25*f1,'g-'); hold off; view(50.5,74);
