std::polar(std::complex)
From cppreference.com
| Defined in header <complex>
|
||
| template< class T > complex<T> polar( const T& r, const T& theta = 0 ); |
(until C++20) | |
| template< class T > complex<T> polar( const T& r, const T& theta = T()); |
(since C++20) | |
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 |
(since C++17) |
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 2870 | C++20 | Default value of parameter theta not dependent | changed to be dependent |
See also
| returns the magnitude of a complex number (function template) | |
| returns the phase angle (function template) |