function b = dclose(f1,f2,dif,i1,j1,dir1,i2,j2,dir2)
%   b = dclose(f1,f2,dif,i1,j1,dir1,i2,j2,dir2)
%
d2r = pi/180;
b = 0;    % initialize as false

if (length(f1)<1) | (length(f2)<1)
  return;
end;
opp = oppdir(f1,f2,dif);
if opp>0
  dc = j2-j1;
  dr = i2-i1;
  theta12 = eightdir(dc,dr);
  theta21 = rem(theta12+4,8);
  same1 = dsame([dir1,theta12],1);
  same2 = dsame([dir2,theta21],1);
  if (same1>0) & (same2>0)
    b = 1;   % true
  end;
end;
