acosh()函数,用于C ++中的复数
的acosh()
是反双曲余弦函数,返回作为参数传递的元件的反双曲余弦。这种功能障碍可以完全排除。所有的都是弧度。
要对Cplusplus中的复数使用此方法,我们需要定义一个模板,以重新定义复数函数。
用于计算复数的反双曲余弦并返回值的函数的语法-
template<class T> complex<T> acosh (const complex<T>& z );
现在,此方法将采用复数作为输入,并返回该数字的反双曲余弦值。
示例
#include <bits/stdc++.h> using namespace std; int main() { complex<double> cNumber(-45.0, 6.0); cout<<"The acosh() of "<<cNumber<< " is "<< acosh(cNumber); return 0; }
输出结果
The acosh() of (-45,6) is (4.5085,3.00901)