function y=modpi(x)

% y = modpi(x)
% 
% Takes input in radians.  Returns values between +/- pi

y = x - 2*pi*round(x/(2*pi));
