使用 MKMapKit 查找两点之间的距离

发布于 2024-09-05 23:17:07 字数 135 浏览 2 评论 0原文

我正在尝试使用 iPhone OS 3.2 查找 MKMapView 上两点之间的欧几里得距离(以米为单位)。问题是我有这些纬度和经度坐标,这在数学上为我提供了足够的数据来找到距离,但这需要一些棘手的三角学。有没有更简单的解决方案?

谢谢!

I'm attempting to find the euclidean distance in meters between two points on an MKMapView using iPhone OS 3.2. The problem is that I have these coordinates in terms of latitude and longitude, which, mathematically provides me enough data to find the distance, but it's going to take some tricky trigonometry. Is there any simpler solution?

Thanks!

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

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

发布评论

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

评论(1

白云不回头 2024-09-12 23:17:07

CLLocation 有一个方法可以为您计算距离:

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

API 文档 此处

CLLocation has a method to calculate the distance for you:

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

API docs here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文