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

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

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


 Live Demo

using namespace std;
main() {
   complex<double> c1(5, 2);
   //acos() function for complex number
   cout << "The acos() of " << c1<< " is "<< acos(c1);


The acos() of (5,2) is (0.386565,-2.37055)