function angle = theta_for_line(x0,y0,normal_angle)
%
% returns angle for Hough transform
%
dir_angle = normal_angle + pi/2;
x1 = x0 + cos(dir_angle);
y1 = y0 + sin(dir_angle);
t = (x0*(x0-x1) + y0*(y0-y1))/((x1-x0)^2 + (y1-y0)^2);
x = x0 + (x1-x0)*t;
y = y0 + (y1-y0)*t;
loc = [x,y];
if (abs(x)<0.1) & (abs(y)<0.1)
  angle = -1;
  return
end
angle = posori(atan2(loc(2),loc(1)));
