【问题标题】:How to find out whether the point belongs to the specified line?如何判断该点是否属于指定线?
【发布时间】:2015-05-19 11:25:08
【问题描述】:

我有路线的基线(步骤):

我有该点的坐标,这正是这些路线之一。我如何知道路线的哪个部分是点?

【问题讨论】:

    标签: google-maps geolocation gis


    【解决方案1】:

    这似乎更像是一个解决方案的数学问题:

    遍历行数组并测试:

    test_point=(x,y);
    for each line (x1,y1),(x2,y2) in the array of lines{
       if(x1<x&x<x2&y1<y&y<y2)&&  
         ((x-x1)/(y-y2)~=(x-x2)/(y-y2))) the point lies in the given line
    }
    

    基本上,确保点 x1

    【讨论】:

      猜你喜欢
      • 2010-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-04
      • 2018-10-27
      • 1970-01-01
      • 2010-12-11
      • 1970-01-01
      相关资源
      最近更新 更多