def length(self): "total worm length" l = 0.0 for i, p1 in enumerate(self.points[:-1]): p2 = self.points[i+1] l += util._dist_line(p1, p2) return l
def length(self): "total worm length" l = 0.0 for i, p1 in enumerate(self.points[:-1]): p2 = self.points[i + 1] l += util._dist_line(p1, p2) return l
def tail_length(self): "return the length of the tail segment" p1, p2 = self.tail_segment return util._dist_line(p1, p2)
def tail_len(self): "length of tail line (could be the whole worm too" return util._dist_line(self.points[0], self.points[1])