Donne les informations importantes sur un nombre complexe.
from math import * # from ion import keydown import matplotlib.pyplot as plt #z = x + iy print("z = x + iy") x = float(eval(input("x = ")).real) y = float(eval(input("y = ")).real) z = complex(x, y) alge = round(z.real, 2) + round(z.imag, 2) * 1j r = round(sqrt(x*x + y*y), 2) theta = round((2*atan((z.imag)/(z.real + r)).real)/pi, 2) print("\nz = {}\nConjugué de z = {}".format(alge, alge.conjugate())) print("Forme exponentielle :\nz = {}e^i{}pi".format(r, theta)) print("\nPresse OK pour la vue graphique") plt.scatter(alge.real, alge.imag, c="b") plt.scatter(0, 0, c='b') # plt.scatter(0,0,s=100000, facecolors="none", edgecolors="r") plt.grid() plt.plot([0, alge.real], [0, alge.imag], color="b") plt.plot([-alge.real-1, alge.real+1], [0, 0], color="r") plt.plot([0, 0], [-alge.imag-1, alge.imag+1], color="r") # plt.autoscale(False) plt.show() # if keydown(KEY_OK):