summaryrefslogtreecommitdiff
path: root/Gaussian2D.m
diff options
context:
space:
mode:
authorMi Zhang <mzhang@email.wm.edu>2012-09-11 16:03:41 -0400
committerMi Zhang <mzhang@email.wm.edu>2012-09-11 16:03:41 -0400
commitd1d7a486cc70665dafe64aaddd44c58e228815b0 (patch)
treeacbf530230d6860c9a85f5f1d67d0e445dde5192 /Gaussian2D.m
downloadbeam_profiler-d1d7a486cc70665dafe64aaddd44c58e228815b0.tar.gz
beam_profiler-d1d7a486cc70665dafe64aaddd44c58e228815b0.zip
initial commit
Diffstat (limited to 'Gaussian2D.m')
-rw-r--r--Gaussian2D.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Gaussian2D.m b/Gaussian2D.m
new file mode 100644
index 0000000..586ea36
--- /dev/null
+++ b/Gaussian2D.m
@@ -0,0 +1,15 @@
+function [z] = Gaussian2D(p,X,Y);
+
+cx = p(1);
+cy = p(2);
+wx = p(3);
+wy = p(4);
+amp = p(5);
+theta = p(6);
+background=p(7);
+Xn = (X-cx)*cos(theta) - (Y-cy)*sin(theta);
+Yn = (X-cx)*sin(theta) + (Y-cy)*cos(theta);
+
+%z = amp*(exp(-2*(Xn).^2./(wx^2)-2*(Yn).^2./(wy^2))) + background;
+
+z = amp*(exp(-2*((Xn).^2./(wx^2)+(Yn).^2./(wy^2)))) + background;