Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过 xValue 和 yValue 确定一个角度,但是如果 xValue 为零,我将不起作用。这种情况下我该怎么办?
Math.atan(yValue/xValue);
使用Math.atan2(y,x);
Math.atan2(y,x)
Math.atan2(1,0)
结果:
1.5707963267948966