import math def deal(yaw): if(yaw<0): print(-(abs(yaw)/math.pi)*180) print(math.degrees(yaw)) else: print((abs(yaw)/math.pi)*180) print(math.degrees(yaw)) yaw=math.pi/6 deal(yaw) yaw=-math.pi/3 deal(yaw)
输出
30.0 29.999999999999996 -60.0 -59.99999999999999