-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathenvoltorias_pilares.py
84 lines (67 loc) · 1.59 KB
/
envoltorias_pilares.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import pyqtgraph as pg
import pyqtgraph.exporters
import numpy as np
import math
momento_x_min = 45
momento_x = 67
momento_y_min = 30
momento_y = 50
'''
theta = 30
z = []
w = []
for theta in range(360):
theta_conv = (theta*math.pi)/180
seno = math.sin(theta_conv)
cosseno = math.cos(theta_conv)
z.append(seno)
w.append(seno)
print(z)
print(w)
'''
x = []
y = []
for i in range(360):
theta = i
theta_conv = (theta*math.pi)/180
seno = math.sin(theta_conv)
seno = momento_y_min * seno
cosseno = math.cos(theta_conv)
cosseno = momento_x_min * cosseno
x.append(seno)
y.append(cosseno)
z = []
w = []
for j in range(360):
theta = j
theta_conv = (theta*math.pi)/180
seno = math.sin(theta_conv)
seno = momento_y * seno
cosseno = math.cos(theta_conv)
cosseno = momento_x * cosseno
z.append(seno)
w.append(cosseno)
# create plot
'''plt = pg.plot(x, y, title='theTitle', pen='r')
plt.showGrid(x=True,y=True)
'''
# create plot
plt = pg.plot()
plt.showGrid(x=True,y=True)
plt.addLegend()
# set properties
plt.setLabel('left', 'Momentos Y', units='KN.m')
plt.setLabel('bottom', 'Momentos X', units='KN.m')
plt.setXRange(0,10)
plt.setYRange(0,20)
plt.setWindowTitle('pyqtgraph plot')
plt.enableAutoRange()
# plot
c1 = plt.plot(x, y, pen='r', name='Envoltória Momentos min')
c2 = plt.plot(z, w, pen='b', name='Envoltória Momentos máx')
#c2 = plt.plot(x, y2, pen='r', symbol='o', symbolPen='r', symbolBrush=0.2, name='blue')
## Start Qt event loop.
if __name__ == '__main__':
import sys
if sys.flags.interactive != 1 or not hasattr(pg.QtCore, 'PYQT_VERSION'):
pg.QtGui.QApplication.exec_()