예제 #1
0
 def distance(self, p1, p2):
     '''Return the L{cosineLaw_} distance in C{radians}.
     '''
     d, _ = unrollPI(p1.lam, p2.lam, wrap=self._wrap)
     return cosineLaw_(p2.phi, p1.phi, d)
예제 #2
0
 def _distances(self, x, y):  # (x, y) radians
     for xk, yk in zip(self._xs, self._ys):
         d, _ = unrollPI(xk, x, wrap=self._wrap)
         yield cosineLaw_(yk, y, d)