function y = mod360(x)

% y = mod360(x)

%    Copyright (C) 1995-1998
%    Massachussetts Institute of Technology
%    Sea Grant AUV Laboratory
%    $Id: mod360.m,v 1.2 1998/10/21 21:53:33 bamoran Exp $	

y = rem( x, 360 );
ii = find( y < 0 );
if ~isempty( ii )
    y(ii) = y(ii) + 360;
end
