質問編集履歴

3

ソースコード一部修正(import math)

2016/10/30 18:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -32,11 +32,9 @@
32
32
 
33
33
 
34
34
 
35
- import sys
35
+ import sys, math
36
36
 
37
- from PyQt5 import QtWidgets, QtGui, QtCore
37
+ from PyQt5 import QtWidgets, QtGui
38
-
39
- from math import *
40
38
 
41
39
 
42
40
 
@@ -94,7 +92,7 @@
94
92
 
95
93
  N = 9
96
94
 
97
- rd = pi/180
95
+ rd = math.pi/180
98
96
 
99
97
  x1 = x0
100
98
 
@@ -104,9 +102,9 @@
104
102
 
105
103
  for j in range(N):
106
104
 
107
- x2 = x[j]*cos(120*i*rd) - y[j]*sin(120*i*rd) + x0
105
+ x2 = x[j]*math.cos(120*i*rd) - y[j]*math.sin(120*i*rd) + x0
108
106
 
109
- y2 = x[j]*sin(120*i*rd) + y[j]*cos(120*i*rd) + y0
107
+ y2 = x[j]*math.sin(120*i*rd) + y[j]*math.cos(120*i*rd) + y0
110
108
 
111
109
  if rflag == -1:
112
110
 
@@ -130,7 +128,7 @@
130
128
 
131
129
  m = 70.0
132
130
 
133
- h = m*sqrt(3.0)/2
131
+ h = m*math.sqrt(3.0)/2
134
132
 
135
133
 
136
134
 

2

ソースコードを一部修正

2016/10/30 18:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -88,6 +88,14 @@
88
88
 
89
89
  def baseItem(self, x0, y0, rflag=0):
90
90
 
91
+ x = [ 35, 19, 10, 3, 0, -3, -10, -19, -35]
92
+
93
+ y = [-20, -20, -5, -5, 0, -5, -5, -20, -20]
94
+
95
+ N = 9
96
+
97
+ rd = pi/180
98
+
91
99
  x1 = x0
92
100
 
93
101
  y1 = y0
@@ -120,14 +128,6 @@
120
128
 
121
129
  if __name__ == "__main__":
122
130
 
123
- x = [ 35, 19, 10, 3, 0, -3, -10, -19, -35]
124
-
125
- y = [-20, -20, -5, -5, 0, -5, -5, -20, -20]
126
-
127
- N = 9
128
-
129
- rd = pi/180
130
-
131
131
  m = 70.0
132
132
 
133
133
  h = m*sqrt(3.0)/2

1

タグの修正

2016/10/30 18:34

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
File without changes