summaryrefslogtreecommitdiff
path: root/examples/LGIplot.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2014-05-13 15:35:26 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2014-05-13 15:58:56 -0400
commitd1b62466d81b164656588ac1c55acff15ee9ea43 (patch)
treecce78f90b0768361c4a268b946848842e1e47456 /examples/LGIplot.m
downloadoptics_toolkit-d1b62466d81b164656588ac1c55acff15ee9ea43.tar.gz
optics_toolkit-d1b62466d81b164656588ac1c55acff15ee9ea43.zip
initial
The optics_toolkit code taken from http://mercury.pr.erau.edu/~greta9a1/downloads/index.html the older version is also available at mathwork web site http://www.mathworks.com/matlabcentral/fileexchange/15459-basic-paraxial-optics-toolkit
Diffstat (limited to 'examples/LGIplot.m')
-rw-r--r--examples/LGIplot.m37
1 files changed, 37 insertions, 0 deletions
diff --git a/examples/LGIplot.m b/examples/LGIplot.m
new file mode 100644
index 0000000..4ed244c
--- /dev/null
+++ b/examples/LGIplot.m
@@ -0,0 +1,37 @@
+% Illustrates the use of LaguerreGaussianE.m by plotting the
+% first 16 Laguerre-Gaussian modes (p,m)=([0:3],[0:3]).
+
+pnumbers=[0:3];
+mnumbers=[0:3];
+pmax=max(pnumbers);
+mmax=max(mnumbers);
+
+w=1;
+R=1e6;
+n=4;
+
+for p=0:pmax
+for m=0:mmax
+
+nrad=240;
+ntheta=240;
+rseed=linspace(0,sqrt(n*w),nrad).^2;
+thetaseed=linspace(0,360,ntheta)*pi/180;
+
+[theta,r]=meshgrid(thetaseed,rseed);
+
+[x,y]=pol2cart(theta,r);
+
+subplot(pmax+1,mmax+1,p*(mmax+1)+m+1)
+h=pcolor(x,y,abs(LaguerreGaussianE([p,m,q_(w,R),1e-6],r,theta,'pol')+LaguerreGaussianE([p,-m,q_(w,R),1e-6],r,theta,'pol')).^2);
+colormap('bone')
+set(gca,'Visible','off');
+set(gcf,'Color','black');
+shading interp;
+%figtext(4.3,-0.7,['(',num2str(p),',',num2str(m),')'],8);
+axis square
+hold off
+shg;
+
+end
+end \ No newline at end of file