Python math 模块
Python math.atan2(y,x) 返回给定的 y 及 x 坐标值的反正切值 atan(y / x),以弧度为单位,结果是在 -pi 和 pi 之间。
Python 版本: 1.4
语法
math.atan2() 方法语法如下:
math.atan2(y, x)
参数说明
返回值
返回一个浮点数,表示y 及 x 坐标值的反正切值,结果是在 -pi 和 pi 之间。
实例
以下实例返回 y/x 的反正切:
输出结果:
1.0121970114513341 1.1071487177940904 1.7738415440483617