且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何计算相对于手机Android手机的旋转

更新时间:2022-06-18 22:50:42

您可以计算任意两个向量之间的角度。如果其中一人有方向北(0方位) - 这只是一个特例。您可以选择任何其他角度为基础,从明年测量只是减去了。

You can calculate an angle between any two vectors. If one of them has direction to North (with 0 azimuth) - this is just a special case. You can choose any other angle as base and just subtract it from next measurements.

有没有办法告诉移动有0方位角没有指向北方。顺便说一句,旋转讲述的是屏幕方向,这是移动旋转的副产物。

There are no means to tell the mobile to have 0 azimuth not pointing to North. BTW, "rotation" is about screen orientation, this is a side product of mobile rotation.