Commit ca4d5c21 authored by AAPylaeva's avatar AAPylaeva
Browse files

Update dir/LABAnumint.py, dir/numint.py files

parents
import math
import numint
def f(x):
return math.sin(x)*math.cos(x)/(5+x)
if __name__ == "__main__":
a=float(input("Введите нижнюю границу: "))
b=float(input("Введите верхнюю границу: "))
step=float(input("Введите шаг интегрирования: "))
print("Ответ: ", numint.integral(f,a,b,step))
def integral(f,a,b,step):
summ=0
n=(b-a)/step
for i in range(int(n)):
x=a+i*step
summ+=step*f(x)
return summ
Supports Markdown
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