From 26af4be18380ae52b7628bd1aafa562b86f86fa4 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 19 Sep 2012 22:57:48 -0400 Subject: Gaussian2D.m cleaned up --- Gaussian2D.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gaussian2D.m b/Gaussian2D.m index 7063b06..db111b1 100644 --- a/Gaussian2D.m +++ b/Gaussian2D.m @@ -7,10 +7,12 @@ cy = p(2); wx = p(3); wy = p(4); amp = p(5); % beam amplitude or peak intensity -theta = p(6); % if beam is ellipticle then it is major axis angle +theta = p(6); % if beam is elliptical then it is major axis angle background=p(7); +% rotate squished beam appropriately 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)+(Yn).^2./(wy^2)))) + background; +% finally we calculate Gaussian profile +z = amp*exp(-2*((Xn/wx).^2+(Yn/wy).^2)) + background; -- cgit v1.2.3