Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lampasova anastasia #11

Open
wants to merge 7 commits into
base: Lampasova_Anastasija
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ dmypy.json

# Pyre type checker
.pyre/
settings.json
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Текущий файл",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
2 changes: 2 additions & 0 deletions Hu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = 'Lampasova Anastasia'
print(f'Hello {name}')
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pylint = "*"

[packages]

[requires]
python_version = "3.7"
141 changes: 141 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Tprogramming_184_2020
# Tprogramming_184_2020

## Лампасова Анастасия 2/184
2 changes: 2 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = "Konstantinov Eugeny"
print(f"Hello {name}")
44 changes: 44 additions & 0 deletions m.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import matplotlib.pyplot as plt
import math

def calc(a, b, x):
numerator = math.asin(math.pow(x,a))-math.acos(math.pow(x,b))
return numerator

def task_a(a, b, xn, xk, dx):
x = xn
result = []
while x <= xk:
y = calc(a, b, x)
result.append([x, y])
x += dx
return result

def task_b(a, b, x_arr):
result = []
for x in x_arr:
y = calc(a, b, x)
result.append([x, y])
return result


if __name__ == "__main__":
a = 2
b = 3
xn = -1
xk = 0.36
dx = 0.05

y = calc(a, b, xn)
print(f'x={xn:.3f} y={y:.3f}')

a_res = task_a(a, b, xn, xk, dx)
print(a_res)

x_arr = [0.08, 0.26, 0.35, 0.41, 0.53]
b_res = task_b(a, b, x_arr)
print(b_res)

plt.plot(*zip(*a_res), 'b')
plt.plot(*zip(*b_res), 'r')
plt.show()