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)

更新於: 30-Jul-2019

121 次瀏覽

啟動你的 職業

透過完成課程獲得認證

開始
廣告