1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
% checkpoint[1][0]=longitude;
% checkpoint[1][1]=lattitude;
% checkpoint[1][2]=altitude;
clear;clc;close;
hold on;figure(1);xlabel('Longitude');ylabel('Latitude');zlabel('Altitude');
AXIS([0 3000 0 3000 100 1000])
nbpts=4;
%Mémorisation des points checkpoints.
% for i=1 : nbpts
% checkpoint(1,i)=1500+rand()*500;
% checkpoint(2,i)=1000+rand()*1000;
% checkpoint(3,i)=100+rand()*1000;
% end
%Mémorisation des points checkpoints.
checkpoint(1,1)=1000;
checkpoint(2,1)=1000;
checkpoint(3,1)=100;
checkpoint(1,2)=1500;
checkpoint(2,2)=1500;
checkpoint(3,2)=130;
checkpoint(1,3)=2000;
checkpoint(2,3)=1300;
checkpoint(3,3)=60;
checkpoint(1,4)=1600;
checkpoint(2,4)=700;
checkpoint(3,4)=140;
temps = 900:1:2100;
w=1; fin=0;
temps = 900:1:2100;
while (fin == 0)
for j=1:3
modu = mod(w,4) ;
if (modu ==0)
modu=(floor(w/3))*nbpts;
end
w
modu
tempo(1,j)=checkpoint(1,modu);
tempo(2,j)=checkpoint(2,modu);
tempo(3,j)=checkpoint(3,modu);
w=(w+1);
end
w=w-2;
yy = spline(tempo(1,:),tempo(2,:),temps);
zz = spline(tempo(1,:),tempo(3,:),temps);
plot3(tempo(1,:),tempo(2,:), tempo(3,:),'ro');
plot3(temps,yy, zz);
if (w>8)
fin =1;
end
end |