python
import numpy as np
import matplotlib.pyplot as plt
def draw_vortex(x, y, theta):
r = np.sqrt(x2 + y2)
theta_rad = np.radians(theta)
x_vortex = r * np.cos(theta_rad + np.log(r))
y_vortex = r * np.sin(theta_rad + np.log(r))
return x_vortex, y_vortex
theta = np.linspace(0, 360, 1000)
x = np.linspace(10, 10, 1000)
y = np.linspace(10, 10, 1000)
X, Y = np.meshgrid(x, y)
Z = np.zeros_like(X)
for i in range(X.shape[0]):
for j in range(X.shape[1]):
x_vortex, y_vortex = draw_vortex(X[i, j], Y[i, j], 10)
Z[i, j] = np.sqrt(x_vortex2 + y_vortex2)
plt.contourf(X, Y, Z, cmap='viridis')
plt.colorbar(label='密度')
plt.title('漩涡图案')
plt.show()