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://www.codercto.com/courses/l/17.html

查看所有标签

Eric Meyer on CSS

Eric Meyer on CSS

Eric Meyer / New Riders Press / 2002-7-8 / USD 55.00

There are several other books on the market that serve as in-depth technical guides or reference books for CSS. None, however, take a more hands-on approach and use practical examples to teach readers......一起来看看 《Eric Meyer on CSS》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具