报错
Topic source模块
import math
def move(x, y, step, angle=0):
nx = x + step * math.cos(angle)
ny = y - step * math.sin(angle)
return nx, ny
调用
import math
from move import move
x1, y1 = move.move(100, 100, 60, math.pi / 6)
x1, y1
- 1
模块
import math
def move(x, y, step, angle=0):
nx = x + step * math.cos(angle)
ny = y - step * math.sin(angle)
return nx, ny
调用
import math
from move import move
x1, y1 = move.move(100, 100, 60, math.pi / 6)
x1, y1
胡朵kura
>>> from move import move
>>> x,y = move(100,100,60,math.pi / 6)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\ToolPY\move.py", line 6, in move
ny = y - step * math.sin(angle)
NameError: name 'ny' is not defined
>>>
求助