Polar Coordinates

  • + 0 comments
    from cmath import phase
    from math import sqrt
    
    com = input()
    
    com = complex(com)
    
    x = com.real
    y = com.imag
    
    r = sqrt((x*x)+(y*y))
    z = phase(com)
    
    print(r)
    print(z)