给定速度的 x 和 y 分量,如何计算角度?

far*_*ich 6 math geometry vector angle

对于在笛卡尔坐标系(忽略 z 轴)中移动的粒子,在给定速度的 x 和 y 分量的情况下,如何计算行进角?

在有人说这与编程无关之前,我现在正在编程,但是,我不知道矢量数学。

例如,假设速度的 x 和 y 值分别为 5.0 和 -1.5,我将如何计算角度?

Rya*_*n S 6

在 Javascript 中,我会使用Math.atan2(1.5, 5.0). 要转换为度数,请使用Math.atan2(1.5, 5.0)/(Math.PI/180). 在维基百科上:http : //en.wikipedia.org/wiki/Atan2