WorksheetFunction.Atan2(Double, Double) 方法

定义

返回指定的 x 和 y 坐标值的反正切值。 反正切值是角度,是从 x 轴到通过原点 (0, 0) 和坐标点 (x_num, y_num) 的直线之间的夹角。 该角度用弧度给出,介于 -pi 和 pi 之间(不包括 -pi)。

public:
 double Atan2(double Arg1, double Arg2);
public double Atan2 (double Arg1, double Arg2);
Public Function Atan2 (Arg1 As Double, Arg2 As Double) As Double

参数

Arg1
Double

点的 x 坐标。

Arg2
Double

点的 y 坐标。

返回

注解

结果为正表示从 x 轴逆时针旋转的角度;结果为负表示从 x 轴顺时针旋转的角度。

Atan2 (a,b) 等于 Atan (b/a) ,但 Atan2 中的 a 可以等于 0。

如果 和 Arg2 均为 Arg1 0,Atan2 将返回错误值。

若要以度表示反正切值,请将结果乘以 180/PI ( ) 或使用 Degrees(Double) 方法。

适用于