std::acos
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <cmath> 中定义
|
||
| float acos( float arg ); |
||
| double acos( double arg ); |
||
| long double acos( long double arg ); |
||
| double acos( Integral arg ); |
(since C++11) | |
计算反余弦的
arg目录 |
[编辑] 参数
| arg | - | 浮点值
|
[编辑] 返回值
arg弧度的范围中以弧度为单位的反余弦[0; π].原文:
Arc cosine of
arg in radians in the range of [0; π] radians.域时会出现错误
arg范围以外的[-1.0; 1.0]。 NAN是在这种情况下,返回.原文:
Domain error occurs if
arg is outside the range [-1.0; 1.0]. NAN is returned in that case.[编辑] 示例
#include <cmath> #include <iostream> int main() { std::cout << "The number pi is " << std::acos(-1) << '\n'; }
输出:
The number pi is 3.14159
[编辑] 另请参阅
| 计算弧的正弦(arcsin(x)) (函数) | |
| 计算反正切值(arctan(x)) (函数) | |
| 圆弧相切,使用标志来确定象限 原文: arc tangent, using signs to determine quadrants (函数) | |
| 计算余弦(cos(x)) (函数) | |
| (C++11) |
计算一个复数的反余弦(arccos(z)) 原文: computes arc cosine of a complex number (arccos(z)) (函数模板) |
| 在valarray的每个元素上调用std::acos函数 (函数模板) |