function [b,del] = rectang(a)

% rectang takes an angle in degrees, and adds or subtracts multiples
% of 360 degrees to bring the angle between 0 and 360 degrees.
%
% begun 12 dec 98 by paul hemenway

if a>=0
   b=a - 360*fix(a/360);
   del=-360*fix(a/360);
else
   b=a + 360*(-fix(a/360) + 1);
   b=rectang(b);
   del=360*(-fix(a/360) + 1);
end


