code: def derivative(self, t, n=1):
          
          angle = radians(self.theta + t*self.delta)
          phi = radians(self.rotation)
          rx = self.radius.real
          ry = self.radius.imag
          k = (self.delta*2*pi/360)**n  # ((d/dt)angle)**n
  
          if n % 4 == 0 and n > 0:
              return rx*cos(phi)*cos(angle) - ry*sin(phi)*sin(angle) + 1j*(
                  rx*sin(phi)*cos(angle) + ry*cos(phi)*sin(angle))
          elif n % 4 == 1:
              return k*(-rx*cos(phi)*sin(angle) - ry*sin(phi)*cos(angle) + 1j*(
                  -rx*sin(phi)*sin(angle) + ry*cos(phi)*cos(angle)))
          elif n % 4 == 2:
              return k*(-rx*cos(phi)*cos(angle) + ry*sin(phi)*sin(angle) + 1j*(
                  -rx*sin(phi)*cos(angle) - ry*cos(phi)*sin(angle)))
          elif n % 4 == 3:
              return k*(rx*cos(phi)*sin(angle) + ry*sin(phi)*cos(angle) + 1j*(
                  rx*sin(phi)*sin(angle) - ry*cos(phi)*cos(angle)))
          else:
              raise ValueError("n should be a positive integer.")
docs: returns the nth derivative of the segment at t.