如何找到半径内的经纬度?
How to find latitude and longitude lies within radius?
我有地方的经纬度。如何找到这些位于其他位置半径内的纬度和经度?
例如具有 (6.8914,79.8522) (lat,long) 的位置,并在半径 10 的位置 (6.9584218,80.1783008) 内找到。
请帮助我。
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。
我有地方的经纬度。如何找到这些位于其他位置半径内的纬度和经度?
例如具有 (6.8914,79.8522) (lat,long) 的位置,并在半径 10 的位置 (6.9584218,80.1783008) 内找到。
请帮助我。
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。