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)
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)
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)