【问题标题】:Given a latitude, longitude and heading, how can I determine the lat/lon that is x meters from that point?给定纬度、经度和航向,我如何确定距离该点 x 米的纬度/经度?
【发布时间】:2011-08-28 07:26:18
【问题描述】:

我有一系列 lat/lon 代表某个对象的中心。我需要在中心两边各 x 米处画一条线并且它需要垂直于航向(想象一个大写字母T

最后我想得到这条线端点的纬度/经度。

谢谢!

【问题讨论】:

    标签: ios mapkit


    【解决方案1】:

    基本计算在这个类似问题的答案中:Calculate second point knowing the starting point and distance。计算垂直于主航向的两个航向的点,距离您想要的距离。

    【讨论】:

    • @Brain:你能修复那个链接吗?
    【解决方案2】:

    看看:Core Location extensions for bearing and distance

    有了这些扩展和初始线上的两个点,您应该能够得到方位,加/减 pi/2 并找到任意一侧的点,如下所示:

    double bearing = [bottomOfT bearingInRadiansTowardsLocation:topOfT];
    CLLocation *left = [topOfT newLocationAtDistance:meters
                                 alongBearingradians:bearing+M_PI/2];
    CLLocation *right = [topOfT newLocationAtDistance:meters
                                  alongBearingradians:bearing-M_PI/2];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-12
      • 2011-08-16
      • 1970-01-01
      • 2012-07-07
      • 2013-02-21
      • 2013-06-06
      • 1970-01-01
      • 2011-07-06
      相关资源
      最近更新 更多