szymcio10

pochodna

Mar 15th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. import math
  2. def derivative(f,x,h):
  3.     return (f(x+h)-f(x))/h
  4.  
  5. def kwadracik(x):
  6.     return x**2
  7.  
  8. print(derivative(math.sin,1.0,0.00001))
  9. print(derivative(math.sin,0.0,0.00001))
  10. print(derivative(kwadracik,1.0,0.00001))
Add Comment
Please, Sign In to add comment