Polar Coordinates

Sort by

recency

|

486 Discussions

|

  • + 0 comments
    from cmath import phase
    z = complex(input())
    print(abs(z))
    print(phase(z))
    
  • + 0 comments
    from cmath import phase
    import re
    
    r = input()
    reg = re.findall('[+|-]*[0-9]+', r)
    
    x, y = map(int, reg)
    
    print(abs(complex(x, y)))
    print(phase(complex(x, y)))
    
  • + 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)
    
  • + 0 comments

    import cmath cn=complex(input()) print(abs(cn)) print(cmath.phase(cn))

  • + 0 comments

    Here is HackerRank Polar Coordinates in python solution - https://programmingoneonone.com/hackerrank-polar-coordinates-solution-in-python.html