Dick Mores wrote:
<snip>
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?

<snip>

I think the neatest approach might be to consider that the n-complex
roots form at equal angle around the origin on an Argand diagram
(basically a cartesian plane) - here the points (in "standard")
cartesian notation are at (1,0), (-0.5, 0.86) and (-0.5, -0.86). The
whole effect looks a bit like a Mercedes-Benz symbol rotated clockwise
by 90 degrees. The points, in this case, lie on the unit circle.

As a result, I think you could just divide 360 by n (for the n-roots),
set the 1st root at (1,0) and then position the others around the
circle, incrementing by the required number of degrees.

If I've remembered correctly, for c where |c| <>1, the argument is the
same, but you need to take the nth root of the absolute value of c (this
can be ignored when we're doing it for 1, as of course the nth root of 1
is 1).

Obviously I haven't included any code....but I hope this helps a bit.

Matt

P.S. Thrilled to be able to answer something on the tutor list, instead
of just asking dumb questions!
-- 
Dr. M. Williams MRCP(UK)
Clinical Research Fellow,Cancer Research UK
+44 (0)207 269 2953
+44 (0)7834 899570

The views, opinions and judgements expressed in this message are solely those 
of the author.
The message may not have been reviewed or approved by Cancer Research UK

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

Reply via email to