So it seems that if you're trying to mod around degrees (so that if you have -50 degrees - 200 degrees), you'd want to use something like:
function modrad(m) { return ((((180+m) % 360) + 360) % 360)-180;}
So it seems that if you're trying to mod around degrees (so that if you have -50 degrees - 200 degrees), you'd want to use something like:
function modrad(m) { return ((((180+m) % 360) + 360) % 360)-180;}