function type = dftype(r11,c11,theta1,r21,c21,theta2)
%
% dftype: returns the direction type for a pair of pixels
% On input:
%     r11,c11: first pixel location
%     theta1:  first pixel gradient direction
%     r21,c21: second pixel location
%     theta2:  second pixel gradient direction
% On output:
%     type:    0  unknown
%              1  vectors continue each other (e.g., .->  .->)
%              2  vectors point away from each other (e.g., <-. .->)
%              3  vectors point at each other (e.g., .-> <-.)
% Calling sequence:
%    type = dftype(r11,c11,theta1,r21,c21,theta2)

t1 = angle2(r11,c11,r21,c21,r11,c11,r11+sin(theta1),c11+cos(theta1));
t2 = angle2(r21,c21,r11,c11,r21,c21,r21+sin(theta2),c21+cos(theta2));

type = 0;   % default
if (t1<pi/2) & (pi/2<t2)
  type = 1;   % continuation
end;
if (pi/2<t1) & (pi/2<t2)
  type = 2;   % pointed away from each other
end;
if (t1<pi/2) & (t2<pi/2)
  type = 3;   % pointed at each other
end;
