clear
clf
r=load('maandumine.dat');
r_maa=6371.;

subplot(2,2,1)
hold on
axis equal
[x,y,z]=sphere(100);
z0=r(:,1)*0.;
earthimage = imread('earth1.jpg');
surf(x,y,-z,earthimage,'FaceColor','texturemap','EdgeColor','none');
plot3(r(:,2)/r_maa,r(:,3)/r_maa,z0,'r')
grid on

subplot(2,2,2)
plot(r(:,6),r(:,8))
xlabel ('korgus,km')
ylabel ('kiirendus, m/s^2')
grid on

subplot(2,2,3)
plot(r(:,6),r(:,7))
ylabel ('kiirus,km/s')
xlabel ('korgus,km')
grid on

subplot(2,2,4)
plot(r(:,1)/60.,r(:,6))
ylabel ('korgus,km')
xlabel ('aeg,min')
grid on

disp(['max kiirendus=',num2str(max(r(find(r(:,6)>5.5),8))),' m/s^2'])
disp(['min kiirus=',num2str(min(r(:,7))),' m/s'])
