summaryrefslogtreecommitdiff
path: root/axial/beamradius.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/beamradius.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/beamradius.m')
-rw-r--r--axial/beamradius.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/axial/beamradius.m b/axial/beamradius.m
new file mode 100644
index 0000000..c5befc2
--- /dev/null
+++ b/axial/beamradius.m
@@ -0,0 +1,28 @@
+% Returns the field radius of the beam at any point z along a Gaussian beam
+%
+% SYNTAX: [w,R,zR]=beamradius([w0,z0,lambda],z);
+%
+% w0 = waist size
+% z0 = position of waist
+% lambda = wavelength
+%
+% w = spot size (field radius) at z
+% R = curvature of phasefront at z
+% zR = Raleigh length.
+%
+%-------------------------------------------------------------------
+% SYNTAX: [w,R,zR]=beamradius([w0,z0,lambda],z);
+%-------------------------------------------------------------------
+
+function [w,R,zR]=beamradius(params,z)
+
+w0=params(1); % beam (field) width at waist [meters]
+z0=params(2); % waist position [meters]
+lambda=params(3); % wavelength [meters]
+zR=pi*w0^2/lambda; % Raleigh length [meters]
+
+w=w0.*sqrt(1+((z-z0)/zR).^2); % beam width at z [meters]
+
+if nargout>=2
+ R=z.*(1+(zR./z).^2); % beam phasefront curvature at z
+end \ No newline at end of file