C 库函数 - acos()

C 语言教程 · 2019-02-23 05:56:44

描述

C 库函数 double acos(double x) 返回以弧度表示的 x 的反余弦。

声明

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

double acos(double x)

参数

  • x -- 介于 [-1,+1] 区间的浮点值。

返回值

该函数返回以弧度表示的 x 的反余弦,弧度区间为 [0, pi]。

实例

下面的实例演示了 acos() 函数的用法。

#include <stdio.h>
#include <math.h>

#define PI 3.14159265

int main ()
{
   double x, ret, val;

   x = 0.9;
   val = 180.0 / PI;

   ret = acos(x) * val;
   printf("%lf 的反余弦是 %lf 度", x, ret);
   
   return(0);
}

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

0.900000 的反余弦是 25.855040 度

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

查看所有标签

Concepts, Techniques, and Models of Computer Programming

Concepts, Techniques, and Models of Computer Programming

Peter Van Roy、Seif Haridi / The MIT Press / 2004-2-20 / USD 78.00

This innovative text presents computer programming as a unified discipline in a way that is both practical and scientifically sound. The book focuses on techniques of lasting value and explains them p......一起来看看 《Concepts, Techniques, and Models of Computer Programming》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

MD5 加密
MD5 加密

MD5 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具