% Plot of the trajectory of the particle for varying angles alpha
clear all;
close all;
clc;

S = load('Plot4.out');
angle = S(:,1);
time = S(:,2);
height = S(:,4);
distance = S(:,3);
distinctAngles = unique(angle);
ctr = 1;
color = [ 'b' 'g' 'r' 'c' 'm' 'y' 'k' 'm' 'g' 'c' 'r'];
for i = 1:length(distinctAngles)
    Length = length(find(S(:,1)== distinctAngles(i)));
    plot(distance(ctr:Length+ctr-1),height(ctr:Length+ctr-1),color(i));
    xlabel('Distance');
    ylabel('Height');
    title('Plot of the trajectory of the particle for varying angles alpha');
    hold on;
    ctr = ctr+Length;
end
    
figure;
ctr = 1;
for i = 1:length(distinctAngles)
    Length = length(find(S(:,1)== distinctAngles(i)));
    plot3(time(ctr:Length+ctr-1),distance(ctr:Length+ctr-1),height(ctr:Length+ctr-1));   
    hold on;
    xlabel('time');
    ylabel('Distance');
    zlabel('Height');
    title('Plot of the trajectory of the particle along various directions');

    ctr = ctr+Length;
end
   









