pytho sin(1/x)震荡间断点
pytho sin(1/x)震荡间断点
import math
import numpy as np
from matplotlib import pyplot as plt
a=np.arange(-1,1,0.00001)
def sx(k):
t1=math.sin(k)/k
return t1
def sx1(k):
t1=math.sin(1/k)
return t1
b=[]
c=[]
for k in a:
if k!=0:
temp1=sx1(k)
c.append(k)
b.append(temp1)
plt.figure(figsize=(8,6))
plt.plot(c,b)
posted on 2019-01-30 16:07 luoganttcc 阅读(...) 评论(...) 编辑 收藏