How to use atan2() in combination with other Radian angle systems
The values are the same in both cases, modulo 2*PI
, and with an adjustment for the different sign and offset convention. Pseudo-code:
theta = 0.5*M_PI - atan2(y, x); // adjust for required sign/offset
theta = fmod(theta, 2.0*M_PI); // make result modulo 2*PI
If you want the angle to increase clockwise from 0 on the y axis, calculate the angle as atan2(x,y). This however give negative angles for x<0, so you should add 2*pi in this case.