def length(self, t0=<NUM_LIT:0>, t1=<NUM_LIT:1>, error=LENGTH_ERROR, min_depth=LENGTH_MIN_DEPTH):
if t0 == <NUM_LIT:0> and t1 == <NUM_LIT:1>:<EOL><INDENT>if self._length_info['<STR_LIT>'] == self.bpoints()and self._length_info['<STR_LIT:error>'] >= errorand self._length_info['<STR_LIT>'] >= min_depth:<EOL><INDENT>return self._length_info['<STR_LIT>']<EOL><DEDENT><DEDENT>if _quad_available:<EOL><INDENT>s = quad(lambda tau: abs(self.derivative(tau)), t0, t1,<EOL>epsabs=error, limit=<NUM_LIT:1000>)[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>s = segment_length(self, t0, t1, self.point(t0), self.point(t1),<EOL>error, min_depth, <NUM_LIT:0>)<EOL><DEDENT>if t0 == <NUM_LIT:0> and t1 == <NUM_LIT:1>:<EOL><INDENT>self._length_info['<STR_LIT>'] = s<EOL>self._length_info['<STR_LIT>'] = self.bpoints()<EOL>self._length_info['<STR_LIT:error>'] = error<EOL>self._length_info['<STR_LIT>'] = min_depth<EOL>return self._length_info['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>return s<EOL><DEDENT>
Calculate the length of the path up to a certain position