def derivative(self, t, n=<NUM_LIT:1>):
angle = radians(self.theta + t*self.delta)<EOL>phi = radians(self.rotation)<EOL>rx = self.radius.real<EOL>ry = self.radius.imag<EOL>k = (self.delta*<NUM_LIT:2>*pi/<NUM_LIT>)**n  <EOL>if n % <NUM_LIT:4> == <NUM_LIT:0> and n > <NUM_LIT:0>:<EOL><INDENT>return rx*cos(phi)*cos(angle) - ry*sin(phi)*sin(angle) + <NUM_LIT>*(<EOL>rx*sin(phi)*cos(angle) + ry*cos(phi)*sin(angle))<EOL><DEDENT>elif n % <NUM_LIT:4> == <NUM_LIT:1>:<EOL><INDENT>return k*(-rx*cos(phi)*sin(angle) - ry*sin(phi)*cos(angle) + <NUM_LIT>*(<EOL>-rx*sin(phi)*sin(angle) + ry*cos(phi)*cos(angle)))<EOL><DEDENT>elif n % <NUM_LIT:4> == <NUM_LIT:2>:<EOL><INDENT>return k*(-rx*cos(phi)*cos(angle) + ry*sin(phi)*sin(angle) + <NUM_LIT>*(<EOL>-rx*sin(phi)*cos(angle) - ry*cos(phi)*sin(angle)))<EOL><DEDENT>elif n % <NUM_LIT:4> == <NUM_LIT:3>:<EOL><INDENT>return k*(rx*cos(phi)*sin(angle) + ry*sin(phi)*cos(angle) + <NUM_LIT>*(<EOL>rx*sin(phi)*sin(angle) - ry*cos(phi)*cos(angle)))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>
returns the nth derivative of the segment at t.