arctan2是比arctan更智能的函数,能自动对象限进行区分,arctan2的函数如下:
python中的编程如下:
import numpy as np
deg = 180.0/np.pi...',wspd, ' wdir =',wdir, ' u =',u, ' v =',v)
# u, v to wspd, wdir
u = 5
v = -10
wdir1 = 180.0 + np.arctan2...(u, v)*deg
wdir2 = 270.0 - np.arctan2(v, u)*deg
print('u =',u,' v =',v, ' wspd =',wspd, ' wdir =',wdir1