Polar Coordinates

  • + 0 comments
    1. import cmath
      1. n = input()
    2. complex_no = complex(n)
    3. real_part = complex_no.real
    4. imaginary_part = complex_no.imag
    5. print(abs(complex(imaginary_part,real_part)))
    6. print(cmath.phase(complex(real_part,imaginary_part)))