code: def length(self, error=ERROR, min_depth=MIN_DEPTH):
          
          start_point = self.point(0)
          end_point = self.point(1)
          return segment_length(self, 0, 1, start_point, end_point, error, min_depth, 0)
docs: Calculate the length of the path up to a certain position