On Nov 18, 2009, at 11:14 AM, I wrote: > return np.fmod(d + 540, 360) - 180 Actually, I think you can just write (d + 540) % 360 - 180 I think we used fmod because of some automatic weave inlining we do that didn't play nice with '%'.