function psi = DailyAngle(t1,t2)
% t1 and t2 are integers that satisfy 0 < t1 < t2 < 5000
% psi is a length-(t2-t1) column vector where psi(t)
% is the angular advance (in radians) of the "red dot" witnessed on from day
% t1+t-1 to day t1+t
N = t2-t1;
psi = zeros(N,1);

[xE,yE] = Earth(t1);
[xM,yM] = Mars(t1);
% v houses "yesterday's" the red dot unit vector
% u houses "today's" red dot unit vector
v = [xM-xE;yM-yE];
v = v/norm(v);
for t = t1+1:t2
% Compute the red dot unit vector for day t
[xE,yE] = Earth(t);
[xM,yM] = Mars(t);
u = [xM-xE;yM-yE];
u = u/norm(u);
% compute the angular advance..
psi(t-t1) = asin(v(1)*u(2)-v(2)*u(1));
v = u;
end