コード例 #1
0
 def _GetLinkWeight(self, link, pinA, pinB):
     """
         Right now, it uses the spherical distance between two points as its
         weight metric.
     """
     spA = SurfacePoint(radius=1.0, theta=pinA.longitude, phi=pinA.latitude)
     spB = SurfacePoint(radius=1.0, theta=pinB.longitude, phi=pinB.latitude)
     return spA.GetDistanceToOther(spB)
コード例 #2
0
ファイル: planetCommon.py プロジェクト: connoryang/1v1dec
def GetDistanceBetweenPins(pinA, pinB, planetRadius):
    spA = SurfacePoint(radius=planetRadius,
                       theta=pinA.longitude,
                       phi=pinA.latitude)
    spB = SurfacePoint(radius=planetRadius,
                       theta=pinB.longitude,
                       phi=pinB.latitude)
    return spA.GetDistanceToOther(spB)
コード例 #3
0
ファイル: clientColony.py プロジェクト: connoryang/1v1dec
 def _GetLinkWeight(self, link, pinA, pinB):
     spA = SurfacePoint(radius=1.0, theta=pinA.longitude, phi=pinA.latitude)
     spB = SurfacePoint(radius=1.0, theta=pinB.longitude, phi=pinB.latitude)
     return spA.GetDistanceToOther(spB)