如何找到半径范围内的纬度和经度?

时间:2016-07-16 10:13:49

标签: php html mysql laravel-5 latitude-longitude

我有经纬度的地方。如何找到这些纬度和经度位于其他一些半径范围内?

例如具有(6.8914,79.8522)(纬度,长度)位置,并在半径10的位置(6.9584218,80.1783008)内找到。

请帮帮我。

1 个答案:

答案 0 :(得分:0)

lat1 = 6.8914 # latitude of point 1
long1 = 79.8522 # longitude of point 1
lat2 = 6.9584218 # latitude of point 2
long2 = 80.1783008 # longitude of point 2

if distance between two geographical points < 10:
   point2 lies inside radius
else:
   it doesn't

您可以通过使用Haversine公式here来了解如何计算两个地理点之间的距离以及程序化实现。

相关问题