cosh(x)函数详解

首页 / C++入门教程 / cosh(x)函数详解

该函数找到以弧度给出的角度的双曲余弦值。

数学上

coshx = ex+ e-x/2

cosh - 语法

假设双曲角为" 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);

cosh - 参数

x :要计算其双曲余弦的角度值。

cosh - 返回值

它返回以弧度表示的双曲余弦角。

cosh - 例子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。

cosh - 例子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   

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

人工智能基础课 -〔王天一〕

微服务架构实战160讲 -〔杨波〕

雷蓓蓓的项目管理实战课 -〔雷蓓蓓〕

大厂晋升指南 -〔李运华〕

React Hooks 核心原理与实战 -〔王沛〕

说透区块链 -〔自游〕

去无方向的信 -〔小麥〕

B端产品经理入门课 -〔董小圣〕

程序员职业规划手册 -〔雪梅〕

好记忆不如烂笔头。留下您的足迹吧 :)