English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C 语言基础教程

C 语言流程控制

Funciones en C

Arreglos en C

Punteros en C

Cadenas en C

C 语言结构体

C 语言文件

C 其他

C 语言参考手册

C 库函数 atan() 使用方法及示例

Biblioteca estándar <math.h> en C

atan()函数计算参数的反正切值。

C atan() 函数原型

double atan(double x);

函数atan()将单个double x作为参数,并返回以弧度表示的值。

atan()返回的值类型是double。

为了更好地了解atan():

[Mathematics] tan-1x = atan(x) [In C programming]

它在<math.h>头文件中定义。

Ctan()范围

库函数atan()取从负到正的任何值。

示例:C atan()函数

#include <stdio.h>
#include <math.h>
#define PI 3.141592654
int main()
{
    double num = 1.0;
    double result;
    result = atan(num);
    printf("tan(%.2printf("\ntan(%.2f ángdu
num, result);
    //将弧度转换成角度
    result = (result * 180) / 0)}
    PI;2printf("\ntan(%.2f) el arco tangente es = %.
    f "grados", num, result);
return 0;

}

cos(1Resultados de salida79 radiantes) el arco tangente es = 0.
cos(1El arco tangente de (0.00) es = 45 grados

Biblioteca estándar <math.h> en C