racinen.py

Created by mino-1289

Created on December 08, 2020

485 Bytes

Renvoie dans la console, toutes les valeurs de z, tel que Z^n = 1. Vous rentrez n via la console.


from cmath import cos, pi, sin

print("Donner la racine nième\nTel que Z^n = 1")
n = int(input("n = "))
print("Toutes les valeurs de solution de\nZ^" + str(n) + " = 1 sont :\n")
for k in range(0, n):
    z = complex(cos((2*k*pi)/n),(sin((2*k*pi)/n)))
    alge = round(z.real, 1) + round(z.imag, 1) * 1j
    print("z" + str(k+1) + "= cos(" + str(2*k) + "pi/" + str(n) + ")+i*sin(" + str(2*k) + "pi/" + str(n) + ")\n   = " + str(alge).replace("j","i") + " \n")
    k += 1

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.