Okay, so I have a rectangular coordinate system where the y axis is inverted... So in this right is positive x and down is positive y.

I need to be able convert from this system to polar coordinates and back again, but in smaller steps, not in some big formula, because this is for programming.

How would I do this?