atan() function for complex number in C++?

Here we will see the atan() method for the complex numbers. The complex numbers can be used using complex header file. In that header file the atan() function is also present. This is complex version of normal atan() function. This is used to find complex arc tan of a complex number.

This function takes a complex number as input parameter, and returns the arc tan as output. Let us see one example to get the idea.


 Live Demo

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)