更新时间:2023-02-09 19:51:47
要指向北方,您可以计算以度为单位的旋转度:
To point the north you can calculate a rotation in degrees :
float rotation = -azimut * 360 / (2 * 3.14159f);
You can see the following compass example which make uses of accelerometer and magnetic field : http://www.codingforandroid.com/2011/01/using-orientation-sensors-simple.html
Wikipédia上的方位角: http://en.wikipedia.org/wiki/方位角
Azimuth on Wikipédia : http://en.wikipedia.org/wiki/Azimuth