The purpose of this task is to explore working with   complex numbers.



Task

Given   n,   find the   nth   roots of unity.




$ include "seed7_05.s7i";
  include "float.s7i";
  include "complex.s7i";
 
const proc: main is func
  local
    var integer: n is 0;
    var integer: k is 0;
  begin
    for n range 2 to 10 do
      write(n lpad 2 <& ": ");
      for k range 0 to pred(n) do
        write(polar(1.0, 2.0 * PI * flt(k) / flt(n)) digits 4 lpad 15 <& " ");
      end for;
      writeln;
    end for;
  end func;