Professional Documents
Culture Documents
In [ ]: import numpy as np
import matplotlib.pyplot as plt
# Define parameters
u, v, w = 2.09, 0.33, 1.96
angles_deg = [63.7721, -51.6935, 47.4041]
l = 1.19
d_min, d_max = -32, 10
gx, gy = 0.6075, -0.6909
n = d_max - d_min + 1
# Calculate theta
theta = np.tile(angles_rad[2], n) + np.deg2rad(np.linspace(start=d_min, s
# Calculate H and K
H = w * np.cos(theta) - gx
K = w * np.sin(theta) - gy
# Calculate X and Y
X = w * np.cos(theta) + (v + l) * np.cos(rho)
Y = w * np.sin(theta) + (v + l) * np.sin(rho)
# Plot
plt.plot(X, Y)
plt.title('Path of a Particle')
plt.xlabel('X Position')
plt.ylabel('Y Position')
plt.grid(True)
plt.show()
file:///Users/anubhav/Desktop/Trial/me232a2.html 1/2
19/02/2024, 17:22 me232a2
file:///Users/anubhav/Desktop/Trial/me232a2.html 2/2