% =========================================================================================
% ===== Beams Produced by Superposition of Two Plane Waves With Not Equal Wavelenghts =====
% =========================================================================================
clc
clear

SamplingRate=10;
Time=-30:1/SamplingRate:30;

Amplitude=1;
Frequency=2;
AngularFrequency=2*pi*Frequency;
Wavenumber=1;
dWavenumberY=0.1;
dWavenumberX=0.1;

for Distance=1:0.2:30
   
   TwoPlaneWaves(fix(Distance),1:length(Time))=Amplitude*2*sin(Wavenumber.*Distance-(AngularFrequency*Distance)).*cos((-dWavenumberX.*Time)+(dWavenumberY.*Distance));
   
end

figure(1);
PropagationParameter=[1:0.1:Distance];
PropagationEvolution=TwoPlaneWaves(PropagationParameter,:);
mesh(Time,PropagationParameter,PropagationEvolution);
h1=mesh(Time,PropagationParameter,PropagationEvolution);
set(h1,'MeshStyle','row');
title('Beams Produced by Superposition of Two Plane Waves With Not Equal Wavelengths');
xlabel('Time');
ylabel('Distance');
zlabel('Amplitude');
hidden off
