我有这张图,它显示了一个多边形,该多边形应该一直在做它已经在做的事情,但是除了要一直旋转多边形之外。我使用旋转变换(“ r = mpl.transforms.Affine2D()。rotate(theta)”)来完成这项工作,但是我应该在没有任何现有功能的情况下进行此操作。 这是我的代码:
import matplotlib.pyplot as plt
import math
xlist = [1, -1, -1]
ylist = [4, 5, 3]
xlist.append(xlist[0])
ylist.append(ylist[0])
plt.plot(xlist, ylist)
for i in range(len(xlist)-1):
print("Point",i,"= (",xlist[i],",",ylist[i],")")
i = 0
velocity_Y = 1
while (i < 16):
xlist = [ item+1 for item in xlist]
ylist = [ item+velocity_Y for item in ylist]
plt.plot(xlist, ylist)
velocity_Y = velocity_Y - 0.17
i = i+1
plt.axis([-2, 25, -2, 10])
plt.show()