Roots of unity: Difference between revisions
m
→{{header|Mathematica}}
Drkameleon (talk | contribs) (Added Arturo implementation) |
|||
Line 1,138:
6: [1, -1, 1/2*(-2-2*I*3^(1/2))^(1/2), -1/2*(-2-2*I*3^(1/2))^(1/2), 1/2*(-2+2*I*3^(1/2))^(1/2), -1/2*(-2+2*I*3^(1/2))^(1/2)]</lang>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
Setting this up in Mathematica is easy, because it already handles complex numbers:
<lang Mathematica>RootsUnity[nthroot_Integer?Positive] := Table[Exp[2 Pi I i/nthroot], {i, 0, nthroot - 1}]</lang>
|