问题描述
我不想考虑图中所示的圆圈没有的情况相交或包含或完全重叠。
我的问题是位置是以度为单位给出的,半径(准确度)是以米为单位给出的。我不知道如何混合这些单位。
在我的情况下,环境是Android,但问题不是Android特定的。
这是使用中心纬度=(纬度圆1)的圆柱等距投影完成的。 + latCircle2)/ 2.0。
(中心经度相同)
()
在上面的链接中获得一个基于米的系统,你还没有乘以常量meterPerDegreeAtEquator,它是40000000 / 360.0
现在你有坐标x,y,就像你在学校里一样。然后你计算在学校学习或在网上找到的圆圈交点。例如:
然后使用逆投影将笛卡尔交点重新转换为lat,lon。
这适用于两个圆之间的距离不超过10 -100km。
注意:以下常见错误,我在与示例代码的讨论中看到:
请注意x与经度有关,纬度与纬度有关。
虽然我们说经纬度。在这种转换公式中,您应该在参数名称等中使用long,lat命令。
参见
I want to find the intersection points of two Locations in Android.
I don't want to consider cases where the circles as shown in the Figure don't intersect or are included or are completely overlapping.
My problem is that the Location is given in degree and the radius (accuracy) is given in meter. I do not know how to mix those Units.
In my case the environment is Android, but the Problem is not Android specific.
You have to convert latitdue, longitude to a cartesian coordinate system, with unit meters.
This is done using a Cyclindrical equidistant projection with center latitude = (latitudeCircle1 + latCircle2) / 2.0.(same for center longitude)
(http://mathworld.wolfram.com/CylindricalEquidistantProjection.html)
In the link above to get a meter based system you have yet to multiply with the constant "meterPerDegreeAtEquator" which is 40000000 / 360.0
Now you have coordinates x,y as you had in school.
Then you calculate the circle intersection points as learned in school, or as found somewhere on the web. E.g here: https://math.stackexchange.com/questions/256100/how-can-i-find-the-points-at-which-two-circles-intersect
Then you convert the cartesian intersection points back to lat, lon using the inverse projection.
This works for a distance between the two circles not more than 10-100km.
Note: Below common error, which I saw in the discussion with your sample code:Please note that x is related to longitude, and y to latitude.Although we say lat/long. In such transformation formulas you should use long,lat order in paramter names etc.See also Lat Long or Long Lat
这篇关于找到两个位置的交叉点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!