std::polar(std::complex) (3) - Linux Man Pages

std::polar(std::complex): std::polar(std::complex)

NAME

std::polar(std::complex) - std::polar(std::complex)

Synopsis


Defined in header <complex>
template< class T >
complex<T> polar( const T& r, const T& theta = T());


Returns a complex number with magnitude r and phase angle theta.
The behavior is undefined if r is negative or NaN, or if theta is infinite.

Parameters


r - magnitude
theta - phase angle

Return value


a complex number determined by r and theta


Defect reports


The following behavior-changing defect reports were applied retroactively to previously published C++ standards.


DR Applied to Behavior as published Correct behavior
LWG_2459 C++98 behavior unclear for some inputs made undefined
LWG_2870 C++98 default value of parameter theta not dependent made dependent

See also


                  returns the magnitude of a complex number
abs(std::complex) (function template)
                  returns the phase angle
arg (function template)