声明“位置已达到”的良好价值在地理坐标中

发布于 2024-09-05 06:46:44 字数 195 浏览 1 评论 0原文

我写了一种行人导航系统。唯一的问题是,我需要一个标准来完成导航。

我的值以纬度/经度对的形式给出。

您认为两个位置相等/接近足以告诉用户他已经达到目标的话,什么是一个好的值?

另请记住,很难说“直接相等”,因为 GPS 模块可能存在差异......

来自欧洲的greetz,

poeschron

I've written a kind of navigation system for pedestrians. The only thing is, that I need a criterion to finish the navigation.

My values are gives as lat/long pairs.

What would you assume would be a good value to say, both positions are equal/near enough to tell the user that he has reached the goal?

Please keep also in mind, that it's idfficult to say "directly equal", because GPS modules may have variances...

greetz from europe,

poeschlorn

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

安静 2024-09-12 06:46:44

如果您将距离与 0.0001(大约 10 米)进行比较,则应该进行设置。

要做到这一点

distance = sqrt( pow ( lat1 - lat2 , 2 ) + pow ( long1 - long2 , 2 ) )
if ( distance < 0.0001 ) {
   //Grats! you got there
}

if you compare the distance to 0.0001 (Around 10 meters) you should be set.

To do this

distance = sqrt( pow ( lat1 - lat2 , 2 ) + pow ( long1 - long2 , 2 ) )
if ( distance < 0.0001 ) {
   //Grats! you got there
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文