code: def length(self, t0=0, t1=1, error=LENGTH_ERROR, min_depth=LENGTH_MIN_DEPTH):
          
          if t0 == 0 and t1 == 1:
              if self._length_info['bpoints'] == self.bpoints() \
                      and self._length_info['error'] >= error \
                      and self._length_info['min_depth'] >= min_depth:
                  return self._length_info['length']
  
          # using scipy.integrate.quad is quick
          if _quad_available:
              s = quad(lambda tau: abs(self.derivative(tau)), t0, t1,
                              epsabs=error, limit=1000)[0]
          else:
              s = segment_length(self, t0, t1, self.point(t0), self.point(t1),
                                 error, min_depth, 0)
  
          if t0 == 0 and t1 == 1:
              self._length_info['length'] = s
              self._length_info['bpoints'] = self.bpoints()
              self._length_info['error'] = error
              self._length_info['min_depth'] = min_depth
              return self._length_info['length']
          else:
              return s
docs: Calculate the length of the path up to a certain position