-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·48 lines (38 loc) · 1.08 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
from core import Application
import math
opr2 = {
"+": lambda x, y: x + y,
"-": lambda x, y: x - y,
"*": lambda x, y: x * y,
"/": lambda x, y: x / y,
"//": lambda x, y: x // y,
"%": lambda x, y: x % y,
"**": lambda x, y: x**y,
}
opr1 = {
"--": lambda x: -x,
"1/": lambda x: 1 / x,
"V": math.sqrt,
"!": math.factorial,
}
const = {
"pi": math.pi,
"pi2": math.pi / 2,
"e": math.e,
"e0": 8.854e-12, # Vacuum permittivity
"m0": 4 * math.pi * 1e-7, # Vacuum permeability
}
app = Application()
app.opr2 = opr2
app.opr1 = opr1
app.const = const
app.opr1["sin"] = lambda x: math.sin(app.goniowrap(x))
app.opr1["cos"] = lambda x: math.cos(app.goniowrap(x))
app.opr1["tan"] = lambda x: math.tan(app.goniowrap(x))
app.opr1["tg"] = lambda x: math.tan(app.goniowrap(x))
app.opr1["asin"] = lambda x: app.a_goniowrap(math.asin(x))
app.opr1["acos"] = lambda x: app.a_goniowrap(math.acos(x))
app.opr1["atan"] = lambda x: app.a_goniowrap(math.atan(x))
app.opr1["atg"] = lambda x: app.a_goniowrap(math.atan(x))
app.mainloop()