我试图在地图上找到阻挡圆圈(a,b,R)的点,问题是地图上使用的坐标随着经度的变化被转换为不同的度量值。我知道这与弧度有关。这是缺少部分的代码:
class Circle(object):
def __init__(self,x,y,R):
self.x = x #Degrees
self.y = y #Degrees
self.R = R #meters
def getRatio(self,x,y):
#This is where the magic happens...
return latRatio, LatRatio
def getBlockingSquareCords(self):
latRation, lonRatio = getLonRatio(x,y)
latD = self.R/latRatio
lonD = self.R/lonRatio
x1 = self.x+latD
y1 = self.y+lonD
x2 = self.x-latD
y2 = self.y-lonD
return (x1,y1,x2,y2)
以下问题对答案有一些提示,但我无法弄清楚 -计算两个经纬度点之间的距离?(Haversine 公式)