std::arg(std::complex) (3) - Linux Manuals
std::arg(std::complex): std::arg(std::complex)
NAME
std::arg(std::complex) - std::arg(std::complex)
Synopsis
Defined in header <complex>
template< class T > (1)
T arg( const complex<T>& z );
long double arg( long double z ); (2) (since C++11)
template< class DoubleOrInteger > (3) (since C++11)
double arg( DoubleOrInteger z );
float arg( float z ); (4) (since C++11)
Calculates the phase angle (in radians) of the complex number z
(since C++11)Additional overloads are provided for float, double, long double, and all integer types, which are treated as complex numbers with zero imaginary component.
Parameters
z - complex value
Return value
If no errors occur, returns the phase angle of z in the interval [−π; π].
Errors and special cases are handled as if the function is implemented as std::atan2(std::imag(z), std::real(z)).
Example
// Run this code
Output:
See also
abs(std::complex) (function template)
polar (function template)
atan2
atan2f
atan2l arc tangent, using signs to determine quadrants
(C++11)
(C++11)
atan2(std::valarray) (function template)