Polar Coordinates

  • + 0 comments

    Enter your code here. Read input from STDIN. Print output to STDOUT

    import cmath

    complejo = complex(input())

    print(complejo)

    con .real se obtiene la parte real y con .img se obtiene la parte imaginaria

    print(complejo.real, complejo.imag)

    imprime The modulus (absolute value) of a complex number x can be computed using the built-in abs() function. There is no separate cmath module function for this operation

    print(abs(complex(complejo.real, complejo.imag)))

    imprimir la fase con complex para llamar el numero complejo bien

    print(cmath.phase(complex(complejo.real, complejo.imag)))