📜  asin()函数,用于C++中的复数

📅  最后修改于: 2021-05-30 08:28:28             🧑  作者: Mango

复杂头文件中定义了用于复数的asin()函数。此函数是asin()函数的复杂版本。此函数用于计算复数z的复数正弦,并返回复数z的反正弦。

句法:

template complex 
       asin (const complex& z );

参数:此方法采用必填参数z ,它代表复数。

返回值:该函数返回复数z的反正弦

下面的程序说明了C++中的asin()函数:

范例1:

// c++ program to demonstrate
// example of asin() function.
  
#include 
using namespace std;
  
// driver program
int main()
{
    complex complexnumber(-2.0, 0.0);
  
    // use of asin() function for complex number
    cout << "The asin of "
         << complexnumber
         << " is "
         << asin(complexnumber)
         << endl;
  
    return 0;
}
输出:
The asin of (-2,0) is (-1.5708,1.31696)

示例2:

// c++ program to demonstrate
// example of asin() function.
  
#include 
using namespace std;
  
// driver program
int main()
{
    complex complexnumber(-2.0, -0.0);
  
    // use of asin() function for complex number
    cout << "The asin of "
         << complexnumber
         << " is "
         << asin(complexnumber)
         << endl;
  
    return 0;
}
输出:
The asin of (-2,-0) is (-1.5708,-1.31696)
要从最佳影片策划和实践问题去学习,检查了C++基础课程为基础,以先进的C++和C++ STL课程基础加上STL。要完成从学习语言到DS Algo等的更多准备工作,请参阅“完整面试准备课程”