Just realized my code sample causes a divide-by-zero due to my lazy derivation of the sign. (You'd think that'd be a C standard library function...) Also, it does overflow after all, around the 270 degree mark. The first is an easy fix; the second, not so much. I'll need to give this some more thought.