function thw = wrap_ang(th)
% function thw = wrap_ang(th)
% wraps an angle to the range +- 180.

thw = 360 * (th/360 - round(th/360));


