マップ上で円 (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)
この次の質問には答えのヒントがありますが、私はそれを理解できませんでした - 2つの緯度経度点間の距離を計算しますか? (Haversine 式)