atand
计算输入实数的反正切值对应的角度。
接口定义
C interface:
float atandf(float x);
double atand(double x);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
返回值
- 正常区间:返回输入x的反正切函数值对应的角度y=atan(x) * 180 / π,y ∈ [-90, +90]。
- 特殊区间:如下所示。
输入值(x)
输出值(y)
+0
+0
-0
-0
+inf
90
-inf
-90
nan
nan
依赖
C: "km.h"
示例
C interface:
// typical usage float x1 = -1.0, x2 = 1.0, x3 = 0.5, x4 = -0.5; // special handling float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN; // print result printf("atand(1.0) = %.15f\n", atand(x1)); printf("atand(-1.0) = %.15f\n", atand(x2)); printf("atand(0.5) = %.15f\n", atand(x3)); printf("atand(-0.5) = %.15f\n", atand(x4)); printf("atand(0.0) = %.15f\n", atand(a)); printf("atand(-0.0) = %.15f\n", atand(-a)); printf("atand(INFINITY) = %.15f\n", atand(b)); printf("atand(-INFINITY) = %.15f\n", atand(c)); printf("atand(NAN) = %.15f\n", atand(d)); /* * atand(1.0) = -45.000000000000000 * atand(-1.0) = 45.000000000000000 * atand(0.5) = 26.565051177077990 * atand(-0.5) = -26.565051177077990 * atand(0.0) = 0.000000000000000 * atand(-0.0) = -0.000000000000000 * atand(INFINITY) = 90.000000000000000 * atand(-INFINITY) = -90.000000000000000 * atand(NAN) = nan * * */
父主题: 三角函数