Roots of unity: Difference between revisions

m
 
(3 intermediate revisions by 3 users not shown)
Line 688:
wait
 
next m</syntaxhighlight>
{{out| Output}}<pre>
 
1, 0i
end</syntaxhighlight>
0.31, 0.95i
-0.81, 0.59i
-0.81, 0.59i
0.30, 0.95i
</pre>
 
==={{header|FreeBASIC}}===
Line 1,120 ⟶ 1,125:
-0,5 - 0,866025403784439i
</pre>
=={{header|EasyLang}}==
{{trans|AWK}}
<syntaxhighlight>
numfmt 4 0
for n = 2 to 5
write n & ": "
for root = 0 to n - 1
real = cos (360 * root / n)
imag = sin (360 * root / n)
write real & " " & imag & "i"
if root <> n - 1
write ", "
.
.
print ""
.
end</syntaxhighlight>
 
{{out}}
<pre>
2: 1 0i, -1 0.0000i
3: 1 0i, -0.5000 0.8660i, -0.5000 -0.8660i
4: 1 0i, 0.0000 1i, -1 0.0000i, -0.0000 -1i
5: 1 0i, 0.3090 0.9511i, -0.8090 0.5878i, -0.8090 -0.5878i, 0.3090 -0.9511i
</pre>
 
=={{header|EchoLisp}}==
<syntaxhighlight lang="scheme">
Line 2,645 ⟶ 2,676:
{{libheader|Wren-complex}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./complex" for Complex
import "./fmt" for Fmt
 
var roots = Fn.new { |n|
2,049

edits