C++ 中的复数的 atan() 函数?
在这里,我们将会看到复数的 atan() 方法。复数可以使用 complex 头文件。在该头文件中,atan() 函数也已经存在。这是普通 atan() 函数的复杂版本。它用于找到复数的复杂反正切。
此函数将复数作为输入参数,并将反正切作为输出返回。让我们看一个示例来了解这个想法。
示例
#include<iostream>
#include<complex>
using namespace std;
int main() {
complex<double> c1(5, 2);
//atan() function for complex number
cout << "The atan() of " << c1<< " is "<< atan(c1);
}输出
The atan() of (5,2) is (1.39928,0.067066)
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP