C 库函数 - atan()

C 语言教程 · 2019-02-23 06:27:50

描述

C 库函数 double atan(double x) 返回以弧度表示的 x 的反正切。

声明

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

double atan(double x)

参数

  • x -- 浮点值。

返回值

该函数返回以弧度表示的 x 的反正切,弧度区间为 [-pi/2,+pi/2]。

实例

下面的实例演示了 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("%lf 的反正切是 %lf 度", x, ret);
   
   return(0);
}

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

1.000000 的反正切是 45.000000 度

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Prometheus: Up & Running

Prometheus: Up & Running

Brian Brazil / O'Reilly Media / 2018-7-9 / USD 49.99

Get up to speed with Prometheus, the metrics-based monitoring system used by tens of thousands of organizations in production. This practical guide provides application developers, sysadmins, and DevO......一起来看看 《Prometheus: Up & Running》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

SHA 加密
SHA 加密

SHA 加密工具