Commit 61887d7c authored by Kittipong Maneewong's avatar Kittipong Maneewong

ส่งงาน week09

parent bed6648b
#1.1 #1.1
#f(x)=e^-x
from math import e from math import e
f1x = (e**(-1.001)-e*-0.999)/0.002 f1x = (e**(-1.001)-e*-0.999)/0.002
def f1x(x,h): def f1x(x,h):
...@@ -7,6 +8,7 @@ f1x(1,0.001) ...@@ -7,6 +8,7 @@ f1x(1,0.001)
#output 2.718282281505946 #output 2.718282281505946
#1.2 #1.2
#f(x)=sin(x)e^(-cos(x))
from math import sin,cos,e from math import sin,cos,e
def fsinx(x,h): def fsinx(x,h):
return ((sin(x+h)*e**(-cos(x+h)))-((sin(x-h)*e**(-cos(x-h)))))/(2*h) return ((sin(x+h)*e**(-cos(x+h)))-((sin(x-h)*e**(-cos(x-h)))))/(2*h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment