正弦波python

时间:2019-07-27 16:06:30

标签: python python-3.6 trigonometry wave

我是python的新手,我只是正弦波弄乱了一点。 我有一个问题,正弦波顶部没有像我应该的那样在0.005和0.015(x轴)处最大。并且我应该在0.01和0.02时为0(x,y)。

知道如何解决此问题吗?

import matplotlib.pyplot as plt # For ploting
import numpy as np # to work with numerical data efficiently

x = np.arange(0,0.02,0.0001) # the points on the x axis for plotting
# compute the value (amplitude) of the sin wave at the for each sample

a = 325.27 * (np.sin(360 * x))

#b = 230 * (np.sin((360-120) * x))

#c = 230 * (np.sin((360+120) * x))

print(x)

plt.plot(x,a, label = 'Sine')
#plt.plot(x,b)
#plt.plot(x,c)
plt.show()
plt.legend()

0 个答案:

没有答案