无涯教程-sinh(x)函数

128 阅读1分钟

该函数计算以弧度给出的角度的双曲正弦值。

数学上

sinhx = (ex-e-x/2

sinh - 语法

假设双曲角为x:

float sinh(float x);
double sinh(double x);
long double sinh(long double x);
double sinh(integral x);

sinh - 参数

x :代表双曲线角的值。

sinh - 返回值

它返回一个角度的双曲正弦。

sinh - 例子1

让我们看一个简单的例子。

#include <iostream>  
#include<math.h>  
using namespace std;  
int main()  
{  
   int x=90;  
   float radian=x*3.14/180;  
   std::cout << "Value of degree is: " << x<<std::endl;  
   cout<<"sinh(radian): "<<sinh(radian);  
    return 0;  
}  

输出:

Value of degree is: 90
sinh(radian): 2.2993   

在此示例中,sinh()函数计算角度为90的双曲正弦并返回值2.2993

sinh - 例子2

让我们看另一个简单的例子。

#include <iostream>  
#include<math.h>  
using namespace std;  
int main()  
{  
   float x=56.4;  
   float radian=x*3.14/180;  
   std::cout << "Value of degree is :" << x<<std::endl;  
   cout<<"sinh(radian): "<<sinh(radian);  
   return 0;  
}  

输出:

Value of degree is :56.4
sinh(radian): 1.15046   

在此示例中,sinh()函数计算角度为56.4的双曲正弦值并返回值1.15。

参考链接

www.learnfk.com/c++/cpp-mat…