C++ 中复数的 Sinh( ) 函数


我们的任务是找到复数的 sin() 函数的工作原理。复数的 sin( ) 函数存在于复数头文件中,这意味着要计算 sin() 的值,我们需要在代码中添加复数值头文件。此函数用于计算复数的双曲正弦。

语法

template<class t> complex<t>
Sinh(const complex<t>& x);

参数

参数 z 可以是任何复数,并且此参数在 sin() 函数的定义中定义,这使得此参数成为必需的。

返回类型

此函数返回 sin( ) 的复数值,因为它包含复数。

输入 − Sinh(0,1)

输出 − (0,0.84147)

输入 − Sinh(1,9)

输出 − (-1.0707,0.6359)

示例

#include<iostream.h>
#include<complex.h>
Using namespace std;
int main( ){
   Complex<double> x(2,7);
   Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl;
   return 0;
}

输出

如果我们运行上述代码,它将生成以下输出

The sin of (2,7) = (2.734,2.4717)

示例

#include<iostream.h>
#include<complex.h>
Using namespace std;
int main( ){
   Complex<double> x(5, 3);
   Cout<< “ The sinh of “ << x << “ = “ << sinh(x) << endl;
   return 0;
}

输出

如果我们运行上述代码,它将生成以下输出

The sin of (5, 3) = (-73.4606,10.4725)

更新于: 14-08-2020

159 次浏览

开启您的 职业

完成课程认证

开始
广告
© . All rights reserved.