2D Gaussian function
%code
fgs = @(x,y)exp(-(sqrt(x.^2+y.^2)-70).^2./(2*30.^2)); % circle radius 70
F2 = fgs (xp,yp);
imagesc(F2)
show:
2D sinusoidal fringe plot:
%code three phases
clc,clear
[xp,yp] = meshgrid(-100:100,-100:100);
f = @(x,y,i)0.5+0.5*cos(2.*pi.*1/30*x - i/3*2*pi);
for i =1:3
F1(:,:,i) = f(xp,yp,i);
end
subplot(221)
imagesc(F1(:,:,1))
subplot(222)
imagesc(F1(:,:,2))
subplot(223)
imagesc(F1(:,:,3))
subplot(224)
plot(F1(100,:,1))
show:
Ring fringe pattern:
%code three phases
clc,clear
[xp,yp] = meshgrid(-100:100,-100:100);
f = @(x,y,i)cos(2.*pi.*1/30.*sqrt(x.^2+y.^2)-i/3*2*pi);
for i =1:3
F1(:,:,i) = f(xp,yp,i);
end
subplot(221)
imagesc(F1(:,:,1))
subplot(222)
imagesc(F1(:,:,2))
subplot(223)
imagesc(F1(:,:,3))
subplot(224)
plot(F1(100,:,1))
show: