def derivative(self, t=None, n=<NUM_LIT:1>):
assert self.end != self.start<EOL>if n == <NUM_LIT:1>:<EOL><INDENT>return self.end - self.start<EOL><DEDENT>elif n > <NUM_LIT:1>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>
returns the nth derivative of the segment at t.