python三角函数的参数需要是数字,比如
a=math.atan2(y,x);
当x,y都传入数组时,即x、y数组中每个项对应计算出反正切值,会报错
TypeError: only size-1 arrays can be converted to Python scalars
想完成这个功能应该怎么解决?
我尝试用for
i=0
for(y_y1,x_x1 in y-y1,x-x1):
phi1[i]=math.atan2(y_y1,x_x1)
print(phi1[i])
i++
报错好像意思是不能in 两个数组 y-y1,x-x1
求解答,python菜鸟>_<