summaryrefslogtreecommitdiff
path: root/axial/prop.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 /axial/prop.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 'axial/prop.m')
-rw-r--r--axial/prop.m32
1 files changed, 32 insertions, 0 deletions
diff --git a/axial/prop.m b/axial/prop.m
new file mode 100644
index 0000000..1c7dd15
--- /dev/null
+++ b/axial/prop.m
@@ -0,0 +1,32 @@
+function [q,p]=prop(q1,abcd,varargin)
+% Propagates a Gaussian beam. [q,p]=prop(q1,abcd <,[l,m],p1>);
+%--------------------------------------------------------------------
+% Propagates a Gaussian beam with complex radius of curvature q1
+% and amplitude factor p1 (optional), according to the ABCD matrix
+% supplied.
+%
+% Returns the new complex beam radius q=(A*q1+B)/(C*q1+D) and the
+% new amplitude factor p = 1/(A+B/q1)^(1+l+m) by which the field is
+% multiplied. (See eqn 4.7.30 in Principles of Lasers by O. Svelto.)
+% If q1 is a vector q and p will be vectors of the same size.
+%
+% For a Hermite Gaussian l,m are the mode designators.
+% For a Laguerre Gaussian l=2p and m is the usual m.
+%
+% SYNTAX: [q,p]=prop(q1,abcd <,[l,m],p1>);
+% <...> indicates optional arguments
+%--------------------------------------------------------------------
+
+if ( nargin>=3 && ~isempty(varargin{1}) ), mode=varargin{1}; else mode=[0,0]; end
+if nargin>=4, p1=varargin{2}; else p1=ones(size(q1)); end
+
+A=abcd(1,1);
+B=abcd(1,2);
+C=abcd(2,1);
+D=abcd(2,2);
+
+ell=mode(1);
+emm=mode(2);
+
+q = (A*q1 + B)./(C*q1 + D);
+p = p1.*exp(i*angle(1./(A+B./q1).^(1+ell+emm))); \ No newline at end of file