This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我正在开发一个应用程序,我想知道我是在向特定位置移动还是远离它。我知道那个特定位置的纬度和经度。例如,假设我在 x 位置并向 y 移动,即 100 英里外。现在,如果我计算这两个位置之间的距离,那么它总是正的,所以我不知道我是在远离还是靠近。第二个选项是跟踪以前的距离并比较以前的距离和新的距离,看看它是否比我要离开的距离更大。
在 Android 中,我们确实从 GPS 获取航向。那么有什么方法可以让我使用这些信息来跟踪我是向 y 移动还是远离它。