phi = np.arange(0, 10*np.pi, 0.1)
a = 1
x = a*phi*np.cos(phi)
y = a*phi*np.sin(phi)
print(phi)
print(x)
print(y)
exit()
dr = (np.diff(x)**2 + np.diff(y)**2)**.5 # segment lengths
print(dr)
r = np.zeros_like(x)
print(r)
r[1:] = np.cumsum(dr) # integrate path
print(r)
r_int = np.linspace(0, r.max(), 200) # regular spaced path
x_int = np.interp(r_int, r, x) # integrate path
y_int = np.interp(r_int, r, y)
print(r_int, x_int, y_int)
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
10