我试图在地图上找到挡住一个圆(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)
下面这个问题对答案有一些提示,但我想不通-Calculate distance between two latitude-longitude points? (Haversine formula)
它只取决于纬度(因为当你向两极移动时,圆圈会变小)。在
相关问题 更多 >
编程相关推荐