Namespaces
Variants
Views
Actions

std::arg(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 20:47, 8 June 2014 by Diego91b (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Defined in header <complex>
template< class T >
T arg( const complex<T>& z );
(1)
long double arg( long double z );
(2) (since C++11)
template< class DoubleOrIngeter >
double arg( DoubleOrInteger z );
(3) (since C++11)
float arg( float z );
(4) (since C++11)

Returns the phase angle (in radians) of the complex number z, i.e. atan2(std::imag(z), std::real(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.

[edit] Parameters

z - complex value

[edit] Return value

the phase angle of z

[edit] See also

returns the magnitude of a complex number
(function template) [edit]
constructs a complex number from magnitude and phase angle
(function template) [edit]
arc tangent, using signs to determine quadrants
(function) [edit]
applies the function std::atan2 to a valarray and a value
(function template) [edit]