I made it into one math function. ([x<0]*180)+90-atan(y/x) Idk why neither of us did this before.
Ta-da... Even better than your version, which was even better than my original. :P