python file: https://drive.google.com/file/d/1nUDO...
import math
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
n=1
fig, a=plt.subplots()
x = np.linspace(-n*math.pi,n*math.pi,100)
def run(frame):
plt.clf()
plt.vlines(0,-n*math.pi,n*math.pi,color='r',linestyles='dashed')
plt.vlines(2,-n*math.pi,n*math.pi,color='b',linestyles='dashed')
plt.vlines(-2,-n*math.pi,n*math.pi,color='g',linestyles='dashed')
plt.vlines(4,-n*math.pi,n*math.pi,color='y',linestyles='dashed')
plt.vlines(-4,-n*math.pi,n*math.pi,color='c',linestyles='dashed')
plt.vlines(6,-n*math.pi,n*math.pi,color='m',linestyles='dashed')
plt.vlines(-6,-n*math.pi,n*math.pi,color='w',linestyles='dashed')
plt.vlines(8,-n*math.pi,n*math.pi,color='xkcd:grey',linestyles='dashed')
plt.vlines(-8,-n*math.pi,n*math.pi,color='xkcd:orange',linestyles='dashed')
circle = plt.Circle((np.sin(-frame),0), radius=0.2, fc='r')
plt.gca().add_patch(circle)
circle = plt.Circle((2+np.sin(2-frame),0), radius=0.2, fc='b')
plt.gca().add_patch(circle)
circle = plt.Circle((-2+np.sin(-2-frame),0), radius=0.2, fc='g')
plt.gca().add_patch(circle)
circle = plt.Circle((4+np.sin(4-frame),0), radius=0.2, fc='y')
plt.gca().add_patch(circle)
circle = plt.Circle((-4+np.sin(-4-frame),0), radius=0.2, fc='c')
plt.gca().add_patch(circle)
circle = plt.Circle((6+np.sin(6-frame),0), radius=0.2, fc='m')
plt.gca().add_patch(circle)
circle = plt.Circle((-6+np.sin(-6-frame),0), radius=0.2, fc='w')
plt.gca().add_patch(circle)
circle = plt.Circle((8+np.sin(8-frame),0), radius=0.2, fc='xkcd:grey')
plt.gca().add_patch(circle)
circle = plt.Circle((-8+np.sin(-8-frame),0), radius=0.2, fc='xkcd:orange')
plt.gca().add_patch(circle)
ax=plt.gca()
ax.set_aspect(1)
ax.set_facecolor('xkcd:black')
plt.xlim([-10,10])
plt.ylim([-1,1])
ani=animation.FuncAnimation(fig,run,frames=600)
writervideo = animation.FFMpegWriter(fps=10)
ani.save('sinani3.mp4', writer=writervideo)
plt.show()
Информация по комментариям в разработке