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



Task

Given   n,   find the   nth   roots of unity.




def nthroots(n):
  (8 * (1|atan)) as $twopi
  | range(0;n) | (($twopi * .) / n) as $angle | [ ($angle | cos), ($angle | sin) ];
 
nthroots(10)