為什么代碼的運算結果和計算器算的不一樣
?def move(x,y,step,angle):
... ? ? nx=x+step*math.cos(angle)
... ? ? ny=y-step*math.sin(angle)
... ? ? return nx,ny
算出來x=100+cos60,y=100-sin60.這樣和返回的值不一樣啊。要交叉才一樣
?def move(x,y,step,angle):
... ? ? nx=x+step*math.cos(angle)
... ? ? ny=y-step*math.sin(angle)
... ? ? return nx,ny
算出來x=100+cos60,y=100-sin60.這樣和返回的值不一樣啊。要交叉才一樣
2016-03-21
舉報
2016-04-16
算了一下,搞清楚了,python中的60,是指弧度,你題主在計算器中的60指的角度,兩者不同。
2016-03-21
小數點的位數不一樣