-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.py
26 lines (23 loc) · 853 Bytes
/
App.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
from ui import Ui_MainWindow
from PyQt5 import QtWidgets
from NewtonFractal import NewtonFractal
class App(QtWidgets.QMainWindow):
def __init__(self) -> None:
super(App, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.buld_fractal_btn.clicked.connect(self.build_fractal)
self.fractal = NewtonFractal()
def build_fractal(self, ) -> None:
a = self.ui.real_edit.text()
a = 0 if len(a) == 0 else float(a)
b = self.ui.image_edit.text()
b = 0 if len(b) == 0 else float(b)
C = complex(a, b)
R = self.ui.r_edit.text()
R = 1e-10 if len(R) == 0 else float(R)
# print(C, R)
px = self.ui.doubleSpinBox.text()
px = px.replace(',', '.')
px = float(px)
self.fractal.plot_fractal(c=C, r=R, px=px)