目录

double atan(double x)

描述 (Description)

C库函数double atan(double x)以弧度为单位返回double atan(double x)的反正切。

声明 (Declaration)

以下是atan()函数的声明。

double atan(double x)

参数 (Parameters)

  • x - 这是浮点值。

返回值 (Return Value)

此函数在区间[-pi/2,+ pi/2]弧度中返回x的主反正切。

例子 (Example)

以下示例显示了atan()函数的用法。

#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main () {
   double x, ret, val;
   x = 1.0;
   val = 180.0/PI;
   ret = atan (x) * val;
   printf("The arc tangent of %lf is %lf degrees", x, ret);
   return(0);
}

让我们编译并运行上面的程序,它将产生以下结果 -

The arc tangent of 1.000000 is 45.000000 degrees
↑回到顶部↑
WIKI教程 @2018