
% Generating plane waves and adding them

k1=[1;0];
k1=[1;1];
k2=[-0.5;1/sqrt(2)];
k3=[0.5;1/sqrt(2)];
phi1=0;
phi2=0;
phi3=-phi1-phi2;
phi3=phi3+0*pi;

%phi1=pi/3;
%phi2=pi/3;
%phi3=pi/3;

R=10;
L=-R;
Npts=200;
x=linspace(L,R,Npts);
y=linspace(L,R,Npts);
[X,Y]=meshgrid(x,y);

U=real(exp(i*(k1(1)*X+k1(2)*Y)+phi1)+...
     0*exp(i*(k2(1)*X+k2(2)*Y)+phi2)+...
     0*exp(i*(k3(1)*X+k3(2)*Y)+phi3));

fs=16;
figure(1)

subplot(1,3,1)
set(gca,'FontSize',[fs]);
surf(X,Y,U);
shading interp
%colormap(gray)
xlabel('x'); ylabel('y'); zlabel('z');
view([12 46])

subplot(1,3,2)
set(gca,'FontSize',[fs]);
surf(X,Y,U);
shading interp
colormap(jet)
view([0 90])
xlabel('x'); ylabel('y'); zlabel('z');

subplot(1,3,3)
set(gca,'FontSize',[fs]);
v=-1;
v=max(max(U))-0.0025;
contour(X,Y,U,[v v],'b');
xlabel('x'); ylabel('y'); zlabel('z');

