I want to reverse a sin
/cos
operation to get back an angle, but I can't figure out what I should be doing.
I have used sin
and cos
on an angle in radians to get the x/y vector as such:
double angle = 90.0 * M_PI / 180.0; // 90 deg. to rad.
double s_x = cos( angle );
double s_y = sin( angle );
Given s_x
and s_y
, is it possible to get back the angle? I thought atan2
was the function to use, but I'm not getting the expected results.