import matplotlib.pyplot as plt import numpy as np #1 x = np.linspace(0,0.01,1000) y = np.exp(x) plt.plot(x,y,'b') y = x + 1 plt.plot(x,y,'r') #הגרפים כמעט זהים
x = np.linspace(0,0.1,1000) y = np.sin(x) plt.plot(x,y,'b') y = x plt.plot(x,y,'r') #הגרפים זהים
import math x = np.linspace(0,0.1,1000) y = np.cos(x) plt.plot(x,y,'b') y = x*0 der = [np.cos(0),-np.sin(0),-np.cos(0),np.sin(0)] for i in range(2): y += der[i%4]*(x**i)/math.factorial(i) plt.plot(x,y,'r')