a=load('dim2.dat');
b=load('kiirendus.dat');
hold on
tindex=1:400:length(a(:,1));
clf

[M,I]=min(b(:,4));
a(:,6:13)=a(:,6:13)/10;

subplot(1,2,1)
hold on
plot(a(I,2),a(I,3),'+','Color','red')
plot (a(:,2),a(:,3),'Color','black')
quiver(a(tindex,2),a(tindex,3),a(tindex,6),a(tindex,7),0)
quiver(a(tindex,2),a(tindex,3),a(tindex,8),a(tindex,9),0)
quiver(a(tindex,2),a(tindex,3),a(tindex,10),a(tindex,11),'Autoscale','off')
quiver(a(tindex,2),a(tindex,3),a(tindex,12),a(tindex,13),'Autoscale','off')
legend('min r','tr','ag','at','aa','atot')
axis equal
grid on

subplot(1,2,2)
hold on
plot (a(:,1),b(:,1))
plot (a(:,1),b(:,2))
plot (a(:,1),b(:,3))
plot (a(:,1),b(:,4))
legend('at','an','atot','r')
grid on

