Controlling PanAz with joystick

I’m trying to pan the sound on a 8 channel system with PanAZ.
so I’ve got a joystick sending midi cc values on x and y dimensions each spanning from 0-127.
I scale them to -1 to 1 to make it like in unit circle.
I can calculate the length of the arrow from the center to the edge by sqrt(x2+y2), which will be used to control the amplitude of PanAZ.
The question is how to get the angle?
atan(y/x) doesn’t give correct radians.
does anyone have a solution to this.

SC does: atan2(y, x)

hjh