有点看不懂呀
import math def move(x, y, step, angle): nx = x + step * math.cos(angle) ny = y - step * math.sin(angle) return nx, ny 这段代码有没有大佬稍微细致的讲解下 nx = x + step * math.cos(angle) ny = y - step * math.sin(angle)这两段看的不是很懂
这样我们就可以同时获得返回值:
>>> x, y = move(100, 100, 60, math.pi / 6) >>> print x, y 151.961524227 70.0 这个pi 又是从来的呀