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



Task

Given   n,   find the   nth   roots of unity.




 
(define (roots-1 n)
   (define theta (// (* 2 PI) n))
   (for/list ((i n))
      (polar 1. (* theta i))))
 
(roots-1 2)
    → (1+0i -1+0i)
(roots-1 3)
    → (1+0i -0.4999999999999998+0.8660254037844388i -0.5000000000000004-0.8660254037844384i)
(roots-1 4)
    → (1+0i 0+i -1+0i 0-i)
 