function b = posori3(a);
%
% posori3 -  puts orientation in 0 to 2pi interval
% On input:
%     a: 2D matrix with angles in radians
% On output:
%     b: 2D matrix with angles in radians between 0 and 2pi
% Call:
%  b = posori3(a);
%

[m,n] = size(a);
b = a;
for ii = 1:m
  for jj = 1:n
    while a(ii,jj) < 0
      b(ii,jj) = a(ii,jj) + 2*pi;
    end
    while b(ii,jj) >= 2*pi
      b(ii,jj) = b(ii,jj) - 2*pi;
    end
  end
end
