标签: android sensormanager
The android doc说:
但是我在我的android设备上测试,音高的范围是-π/ 2到π/ 2,侧倾的范围是-π到π。 然后检查SensorManager.getOrientation的源代码,发现音高是由Math.asin计算的,而侧倾是Math.atan2的:
我们知道,Math.asin的范围返回为-π/ 2到π/ 2 ,Math.atan2的范围返回为-π到π ,因此与the android doc矛盾。