function ans=lens(f) %this function uses ABCD matrices to perform free space propagation global xx yy a1 M=[1,0;-1/f,1]; a2=M*a1; a1=a2;