# Lissajous' figures
# Lissajous' figures
# python code is as follows:
import numpy as np
import matplotlib.pyplot as plt
a=1
b=1
p=9
q=10
c=0.0
t = np.linspace(0,6.28, 1000)
x = a*np.sin(p*t)
y= b*np.cos(q*t+c)
plt.figure(figsize=(8,6))
plt.plot(x,y,color="red",linewidth=2)
plt.title("Lissajous' figures")
plt.show()
# The output is as follows:
# 圓的漸伸線
# 圓的漸伸線
# python code is as follows:
import numpy as np
import matplotlib.pyplot as plt
a=1
t = np.linspace(0,30,300)
x = a*(np.cos(t)+t*np.sin(t))
y= a*(np.sin(t)-t*np.cos(t))
plt.figure(figsize=(8,6))
plt.plot(x,y,color="red",linewidth=2)
plt.show()
# The output is as follows:
訂閱:
文章 (Atom)