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 --- transverse/hermitepoly.m | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 transverse/hermitepoly.m (limited to 'transverse/hermitepoly.m') diff --git a/transverse/hermitepoly.m b/transverse/hermitepoly.m new file mode 100644 index 0000000..43b77d6 --- /dev/null +++ b/transverse/hermitepoly.m @@ -0,0 +1,18 @@ +%----------------------------------- +% Hermite Polynomial +% (See e.g. Arfken section 13.1) +% +% SYNTAX y=hermitepoly(n,x) +%----------------------------------- + +function y=hermitepoly(n,x) + +m=[0:floor(n/2)]; + +a=factorial(n-2*m); +b=factorial(m); + +y=zeros(size(x)); +for s=1:length(m) + y = y + factorial(n) ./ a(s) ./ b(s) .* (-1).^m(s) * (2*x).^(n-2*m(s)); +end -- cgit v1.2.3