clear all
close all

%directory_name='/home/clauset/WheelData/';
image_file_name='0630_12cups00';

num_images=89;
first_image=10;
dt=0.5;

matlab_time=[first_image+1:num_images+first_image]'*dt;

load ball

% for ii=1:num_images;
%     eval(['test=imread(''' directory_name image_file_name num2str(first_image+ii-1) '.tif''' ');']);
%     image(test)
%     [x,y]=ginput(2);
%     ball(ii,:)=[x(1),y(1)];
%     centre(ii,:)=[x(2),y(2)];
% end

% x=ball(:,1)-mean(ball(:,1));
% y=ball(:,2)-mean(ball(:,2));

x=ball(:,1)-centre(:,1);
y=ball(:,2)-centre(:,2);

r_matlab=sqrt(x.^2+y.^2);
theta_matlab=atan(y./x);

load theta

figure
plot(matlab_time,theta_matlab,raw_time,raw_theta,time,theta,'r')
legend('manual','raw automated','interpolated automated')

save points100 theta_matlab matlab_time r_matlab