SensorManager.getOrientation的俯仰和横滚返回的实际范围是多少?

时间:2019-11-13 12:31:42

标签: android sensormanager

The android doc说:

android doc

但是我在我的android设备上测试,音高的范围是-π/ 2到π/ 2,侧倾的范围是-π到π。
然后检查SensorManager.getOrientation的源代码,发现音高是由Math.asin计算的,而侧倾是Math.atan2的: the source code of SensorManager.getOrientation

我们知道,Math.asin的范围返回为-π/ 2到π/ 2 ,Math.atan2的范围返回为-π到π ,因此与the android doc矛盾。

0 个答案:

没有答案