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.

Example

 Live Demo

#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);
}

Output

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

Updated on: 30-Jul-2019

96 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements