def get_directed_hausdorff_distance(self, other):
if other.contains(self):
return 0.0
if other.is_empty():
return math.pi
other_complement_center = other.get_complement_center()
if self.contains(other_complement_center):
return self.__class__.positive_distance(other.hi(),
other_complement_center)
else:
if self.__class__(other.hi(), other_complement_center) \
.contains(self.hi()):
hi_hi = self.__class__.positive_distance(other.hi(), self.hi())
else:
hi_hi = 0
if self.__class__(other_complement_center, other.lo()) \
.contains(self.lo()):
lo_lo = self.__class__.positive_distance(self.lo(), other.lo())
else:
lo_lo = 0
assert hi_hi > 0 or lo_lo > 0
return max(hi_hi, lo_lo)
评论列表
文章目录