Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AAPylaeva
lab.numint
Commits
ca4d5c21
Commit
ca4d5c21
authored
Mar 13, 2021
by
AAPylaeva
Browse files
Update dir/LABAnumint.py, dir/numint.py files
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
dir/LABAnumint.py
0 → 100644
View file @
ca4d5c21
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
))
dir/numint.py
0 → 100644
View file @
ca4d5c21
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment