C++ Math cosh()
C++ Math cosh()
该函数查找以弧度给出的角度的双曲余弦。
Math 上
语法
假设双曲角为" x":
float cosh(float x);
double cosh(double x);
long double cosh(long double x);
double cosh(integral x);
参数
x : 要计算其双曲余弦的角度值。
返回值
它返回以弧度表示的双曲余弦值。
示例1
让我们看一个简单的示例,当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、
示例2
让我们看看另一个简单的例子例子。
#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