function template
<complex>

# std::arg

complex (1) ```template T arg (const complex& x); ```
complex (1) ```template T arg (const complex& x); ``` `double arg (ArithmeticType x); // additional overloads`
Phase angle of complex
Returns the phase angle (or angular component) of the complex number x, expressed in radians.

The phase angle of a complex number is the angle the theoretical vector to `(real,imag)` forms with the real axis (i.e., its arc tangent). It returns the same as:
 `` `` ``atan2(x.imag(),x.real());``

Only available for instantiations of complex.
Additional overloads are provided for arguments of any fundamental arithmetic type: In this case, the function assumes the value has a zero imaginary component.
The return type is `double`, except if the argument is `float` or `long double` (in which case, the return type is of the same type as the argument).

x
Complex value.

### Return value

Phase angle of x.
T is the type of the components of the complex type (i.e., its value type).

### Example

 ``12345678910111213`` ``````// arg complex example #include // std::cout #include // std::complex, std::abs, std::arg int main () { std::complex mycomplex (3.0,4.0); std::cout << "The polar form of " << mycomplex; std::cout << " is " << std::abs(mycomplex) << "*e^i*" << std::arg(mycomplex) << "rad\n"; return 0; }``````

Output:
 ``` The polar form of (3,4) is 5*e^i*0.927295rad ```