¿Cómo se animan dos arcos usando matplotlib?

desde matplotlib importa pyplot como plt
de animación de importación matplotlib
desde matplotlib.patches import Arc
de las matemáticas import pi, sin

roboWidth = float (input (“ancho del Robot \ n:”))
driveDistance = float (input (“distancia del objetivo \ n:”))
#theta = float (input (“ángulo de giro (en términos de pi) \ n:”))

fig = plt.figure ()

ax = plt.axes (xlim = (-10,10), ylim = (-10,10))

leftPath = Arc ([0,0], 0,0,0,0,0, color = ‘verde’, ancho de línea = .5, animado = Verdadero)
rightPath = Arc ([0,0], 0,0,0,0,0, color = ‘rojo’, ancho de línea = .5, animado = Verdadero)

def animate (i):
# ————– obtiene variables definidas globalmente ——–
impulso globalDistancia
roboWidth global

# ———- establece variables preliminares —————-
degTheta = i + 1 # <——- evita la división por cero
miniRadius = (driveDistance / 2) / (sin (degTheta * pi / 180))
roboCenter = -1 * (miniRadius)
leftRadius = miniRadius – roboWidth / 2
rightRadius = miniRadius + roboWidth / 2

# ——— establece los atributos de los arcos —————
leftPath.xy = [roboCenter, 0]
leftPath.width = leftRadius * 2
leftPath.height = leftRadius * 2
leftPath.angle = degTheta

leftPath.xy = [roboCenter, 0]
leftPath.width = rightRadius * 2
leftPath.height = rightRadius * 2
leftPath.angle = degTheta

ax.add_patch (leftPath)
ax.add_patch (rightPath)

anim = animation.FuncAnimation (fig, animar, cuadros = 360, intervalo = 20)
plt.show ()