From d1b62466d81b164656588ac1c55acff15ee9ea43 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Tue, 13 May 2014 15:35:26 -0400 Subject: 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 --- axial/prop.m | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 axial/prop.m (limited to 'axial/prop.m') 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 -- cgit v1.2.3