clear
clc

Amplitude=3;

% WaveNumber (Wavelength=1.5708)
X=-10:1/100:10;
WaveNumber1=4;

% Angular Frequency (Period=1.5708)
AngularFrequency1=4;

Wave1(1,1:length(X))=Amplitude.*sin((WaveNumber1.*X)-(AngularFrequency1.*1));
for Time=2:10
    
Wave1(Time,1:length(X))=Amplitude.*sin((WaveNumber1.*X)-(AngularFrequency1.*Time));

end

figure(1);

OriginalWave=Wave1(1,1:length(X));
subplot(3,1,1);
plot(X,OriginalWave);
title('The Original Wave [î(x,t)=A*sin(kx-ùt)]');
ylabel('Amplitude');
grid on

OriginalWave=Wave1(2,1:length(X));
subplot(3,1,2);
plot(X,OriginalWave);
title('The Original Wave Propagated By One Unit Time');
ylabel('Amplitude');
grid on

subplot(3,1,3);
PropagationParameter=[1:1:Time];
PropagationEvolution=Wave1(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h1=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h1,'MeshStyle','row');
title('The Wave Propagated to The Left');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off

%========================================================

Amplitude=3;

% WaveNumber (Wavelength=1.5708)
X=-10:1/100:10;
WaveNumber1=4;

% Angular Frequency (Period=1.5708)
AngularFrequency1=4;

Wave1(1,1:length(X))=Amplitude.*sin((WaveNumber1.*X)+(AngularFrequency1.*1));
for Time=2:10
    
Wave1(Time,1:length(X))=Amplitude.*sin((WaveNumber1.*X)+(AngularFrequency1.*Time));

end

figure(2);

OriginalWave=Wave1(1,1:length(X));
subplot(3,1,1);
plot(X,OriginalWave);
title('The Original Wave [î(x,t)=A*sin(kx+ùt)]');
ylabel('Amplitude');
grid on

OriginalWave=Wave1(2,1:length(X));
subplot(3,1,2);
plot(X,OriginalWave);
title('The Original Wave Propagated By One Unit Time');
ylabel('Amplitude');
grid on

subplot(3,1,3);
PropagationParameter=[1:1:Time];
PropagationEvolution=Wave1(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h1=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h1,'MeshStyle','row');
title('The Wave Propagated to The Right');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off