#397 Spiral that goes around circular paraboloid by python
Dec 18, 2023 | matplotlib, python |
Link text
2 | import matplotlib.pyplot as plt |
4 | ax = plt.axes(projection = '3d' ) |
8 | r = np.linspace( 0 , r0, 50 ) |
9 | p = np.linspace( 0 , 2 * np.pi, 50 ) |
10 | R, P = np.meshgrid(r, p) |
13 | X, Y = R * np.cos(P), R * np.sin(P) |
15 | ax.plot_surface(X, Y, Z, linewidth = 0 , antialiased = False , alpha = 0.2 ) |
17 | u = np.arange( 0 , 29 , 0.1 ) |
20 | z = - (x * * 2 + y * * 2 ) + r0 * * 2 |
22 | ax.plot3D(x, y, z, 'r' ) |
23 | plt.savefig( "ex397.png" , dpi = 100 ) |
Like this:
Like Loading...
Related
Recent Comments