
load ball.dat;
[N,M]=size(ball);
x=ball(1:N-1,:)-ball(2:N,:);
size(x)
x=sqrt(sum((x.^2)')');
x(N)=0;
i=1;
for ii=1:N;
	s(i,:)=ball(ii,:);
	i=i+1;
	if (x(ii) > 20)
		i
		if ( i>10) 
			vx=zeros(1,1);
			vy=zeros(1,1);
			figure(1);
			for j1=1:i-11;
			[a,b]=vel(s(j1:j1+9,1));	
			vx(j1)=a;
			[a,b]=vel(s(j1:j1+9,2));
			vy(j1)=a;
			end;
	                v=sqrt(vx.^2+vy.^2);
			plot(vx);
			figure(2);
			plot(vy);
			figure(3);
			plot(v);
			figure(4);
			plot(s(1:i-1,1),s(1:i-1,2));
			k=waitforbuttonpress;
		end;
		i=1;
	end;
end;


