C ++中的复数的atan()函数?

在这里,我们将看到atan()复数的方法。可以使用复杂头文件使用复数。在该头文件中,该atan()方法也存在。这是正常atan()方法的复杂版本。这用于查找具有复数的复数反正切。

此函数将复数作为输入参数,并返回反正切作为输出。让我们看一个例子来了解这个想法。

示例

#include<iostream>
#include<complex>
using namespace std;
int main() {
   complex<double> c1(5, 2);
   //复数的atan()函数
   cout << "The atan() of " << c1<< " is "<< atan(c1);
}

输出结果

The atan() of (5,2) is (1.39928,0.067066)