function [theta] = arm(filename, fps)

%ARM
%Generates a vector representing theta as a function of time.
%Takes as input a file of the format
%FPS = the framerate of the video capture
%then columns of Rx, Ry, Bx, By.

M = dlmread(filename,'\t'); %Read in the file
Rx = M(:,1); %Set each of the points
Ry = M(:,2);
Bx = M(:,3);
By = M(:,4);

%Find the total time from the framerate
Ttotal = length(Rx)/fps;
%Make a time axis for plotting
t = (0:Ttotal/(length(Rx)-1):Ttotal)';

%Get the output angle
theta(:,1) = t;
theta(:,2) = -atan2( (By-Ry), (Bx-Rx) );