polar() function for complex number in C++
The polar() function for complex number is defined in the complex header file.The polar function is used to find the complex number from phase angle and magnitude.
- mag: It represents the magnitude of the complex number.
- angle: It represents the phase angle.
Returns: This function returns a complex number which is obtain by phase angle and magnitude.
Below program illustrate the above function:-
The complex number whose magnitude is 4.0 and phase angle 1.5 is (0.282949,3.98998)
The complex number whose magnitude is 2.0 and phase angle 0.5 is (1.75517,0.958851)