我希望能够通过反转sin
/cos
运算来获取角度,但是我不知道应该怎么做。
我已经使用弧度制下的 sin
和 cos
函数得到了 x/y 向量,如下所示:
double angle = 90.0 * M_PI / 180.0; // 90 deg. to rad.
double s_x = cos( angle );
double s_y = sin( angle );
已知 s_x
和 s_y
,能否计算出对应的角度呢?我认为应该使用函数 atan2
,但是结果不如预期。