# phase() complex function in python by R4R Team

- phase() is python complex function predefined in cmath library and used to find the phase of the complex number.
- phase in a complex number is a angle between the positive real axis and the vector representing complex number.

Syntax-

cmath.phase(complex)

program-

import cmath

n=complex(12,6)
print("Complex number is ",n)
print("Phase is ",cmath.phase(n))

n=complex(1,2)
print("Complex number is ",n)
print("Phase is ",cmath.phase(n))

n=complex(3,0)
print("Complex number is ",n)
print("Phase is ",cmath.phase(n))

n=complex(0,3)
print("Complex number is ",n)
print("Phase is ",cmath.phase(n))

output-

Complex number is (12+6j)
Phase is 0.4636476090008061
Complex number is (1+2j)
Phase is 1.1071487177940904
Complex number is (3+0j)
Phase is 0.0
Complex number is 3j
Phase is 1.5707963267948966

-In this program, we have a different complex numbers and for each number we find the phase of the number by cmath.phase(n) where cmath is a library and phase() is a function and n is a complex number.