% file m10472_1.m 
% Imaging homework
% for ECEU692
% by Chuck DiMarzio
% Northeastern University
% January 2004
%
lambda=500e-9;
k=2*pi/lambda;
z=2e-2;
x=[-250:1:250]'*1e-6;
x1=[-250:1:250]'*1e-6;
[xx,xx1]=meshgrid(x,x1);
r=sqrt((xx1-xx).^2+z^2);
m=exp(i*k*r);
u1=zeros(size(x1));
u1(find(x1==0))=1;
u=m*u1;
figure;
subplot(2,2,1);
plot(x1*1e6,real(u1));xlabel('x1,\mum'),ylabel('Re u1');
subplot(2,2,2);
plot(x1*1e6,imag(u1));xlabel('x1,\mum'),ylabel('Im u1');
subplot(2,2,3);
plot(x*1e6,real(u));xlabel('x,\mum'),ylabel('Re u');
subplot(2,2,4);
plot(x*1e6,imag(u));xlabel('x,\mum'),ylabel('Im u');
figure;
subplot(2,1,1);
plot(x1*1e6,abs(u1).^2);xlabel('x1,\mum'),ylabel('|u1|^2');
subplot(2,1,2);
plot(x*1e6,abs(u).^2);xlabel('x,\mum'),ylabel('|u|^2');





