import matplotlib.pyplot as plt
import numpy as np
import matplotlib.tri as mtri
ax=plt.axes(projection='3d')
t=np.linspace(0,2*np.pi,endpoint=True,num=100)
s=np.linspace(-1,1,endpoint=True,num=100)
t,s=np.meshgrid(t,s)
t=t.flatten()
s=s.flatten()
x=(2+0.5*s*np.cos(0.5*t))*np.cos(t)
y=(2+0.5*s*np.cos(0.5*t))*np.sin(t)
z=0.5*s*np.sin(0.5*t)
tri=mtri.Triangulation(t,s)
ax.plot_trisurf(x,y,z,cmap=plt.cm.CMRmap,triangles=tri.triangles)
ax.set_xlim(-2,2)
ax.set_ylim(-2,2)
ax.set_zlim(-1,1)
plt.title('2.11')
plt.show()
莫比乌斯环
最新推荐文章于 2022-09-21 22:04:05 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)