该函数找到以弧度给出的角度的双曲余弦值。
数学上
假设双曲角为" x":
链接:https://www.learnfk.comhttps://www.learnfk.com/c++/cpp-math-cosh-function.html
来源:LearnFk无涯教程网
float cosh(float x); double cosh(double x); long double cosh(long double x); double cosh(integral x);
x :要计算其双曲余弦的角度值。
它返回以弧度表示的双曲余弦角。
让我们看一个简单的例子,当x的值是整数类型时。
#include <iostream> #include<math.h> using namespace std; int main() { int x=45; float radian=x*3.14/180; std::cout << "Value of degree is :" <<x<<std::endl; cout<<"cosh(radian): "<<cosh(radian); return 0; }
输出:
Value of degree is :45 cosh(radian): 1.32426
在此示例中,cosh()计算角度为45的双曲余弦并返回值1.324。
让我们看另一个简单的例子。
#include <iostream> #include<math.h> using namespace std; int main() { float x=25.5; float radian=x*3.14/180; std::cout << "Value of degree is: " << x<<std::endl; cout<<"cosh(radian): "<<cosh(radian); return 0; }
输出:
Value of degree is: 25.5 cosh(radian): 1.10058
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)