Do you want : the roots of 1 ? or something more general ?
Because the nth-roots of 1 are defined by :

    r = exp(2*i*pi*k/n) with k = {0,1,...n-1}

If it's more complex ... then I don't know :)

Pierre

Dick Moores a écrit :
My trusty $10 Casio calculator tells me that the 3 cube roots of 1 are:
1, (-.5 +0.866025403j), and (-.5 -0.866025403j), or thereabouts. Is there a way to do this in Python?


Checking the Casio results with Python:
 >>> 1**3
1
 >>> (-.5 + .866025403j)**3
(0.99999999796196859+1.1766579932626087e-009j)
 >>> (-.5 - .866025403j)**3
(0.99999999796196859-1.1766579932626087e-009j)


Thanks,

Dick Moores
[EMAIL PROTECTED]

_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor


-- Pierre Barbier de Reuille

INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP
Botanique et Bio-informatique de l'Architecture des Plantes
TA40/PSII, Boulevard de la Lironde
34398 MONTPELLIER CEDEX 5, France

tel   : (33) 4 67 61 65 77    fax   : (33) 4 67 61 56 68
_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to