Roots of unity: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 875: | Line 875: | ||
(for/list ([k n]) |
(for/list ([k n]) |
||
(make-polar 1 (* k (/ (* 2 pi) n)))))</lang> |
(make-polar 1 (* k (/ (* 2 pi) n)))))</lang> |
||
Will produce a list of roots, for example: |
|||
<pre> |
|||
> (for ([r (roots-of-unity 3)]) (displayln r)) |
|||
1 |
|||
-0.4999999999999998+0.8660254037844388i |
|||
-0.5000000000000004-0.8660254037844384i</pre> |
|||
=={{header|RLaB}}== |
=={{header|RLaB}}== |