diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-05-13 15:35:26 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-05-13 15:58:56 -0400 |
commit | d1b62466d81b164656588ac1c55acff15ee9ea43 (patch) | |
tree | cce78f90b0768361c4a268b946848842e1e47456 /axial/L_.m | |
download | optics_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/L_.m')
-rw-r--r-- | axial/L_.m | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/axial/L_.m b/axial/L_.m new file mode 100644 index 0000000..351af31 --- /dev/null +++ b/axial/L_.m @@ -0,0 +1,23 @@ +%---------------------------------------------------------------
+% Given the q-factor and wavelength of a beam, this function
+% returns the position and size of the waist.
+%
+% SYNTAX: [L <,w0>]=L_(q <,lambda>);
+% <...> indicates optional arguments
+%
+% q = q-factor of the beam at the position where R and w are to
+% be found. q can be a vector
+% lambda = wavelength. Can be a vector or scalar.
+%
+% If both q and lambda are vectors, they must be the same size.
+%
+%---------------------------------------------------------------
+% SYNTAX: [L <,w0>]=L_(q <,lambda>);
+%---------------------------------------------------------------
+
+function [L,w0]=L_(q,varargin);
+
+if nargin>=2, lambda=varargin{1}; else lambda=1064e-9; end
+
+w0=sqrt(-lambda/pi./imag(1./q));
+L=-real(q).*ones(size(w0));
\ No newline at end of file |