summaryrefslogtreecommitdiff
path: root/axial/beamradius.m
diff options
context:
space:
mode:
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