import numpy as np
import matplotlib.pyplot as plt
# Define parameter t
t = np.linspace(0, 2*np.pi, 1000)
# Define x and y coordinates using parametric equations
x = np.sin(t)
y = np.sin(t)*np.cos(t)
# Plot the trajectory
plt.plot(x, y)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('8-Shaped Trajectory')
plt.axis('equal') # Equal aspect ratio
plt.grid(True)
plt.show()
chatgpt 8字形轨迹
于 2024-05-11 10:07:22 首次发布