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.

Example

 Live Demo

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

Output

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

Updated on: 30-Jul-2019

109 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements