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



Task

Given   n,   find the   nth   roots of unity.




      @% = &20408
      FOR n% = 2 TO 5
        PRINT STR$(n%) ": " ;
        FOR root% = 0 TO n%-1
          real = COS(2*PI * root% / n%)
          imag = SIN(2*PI * root% / n%)
          PRINT real imag "i" ;
          IF root% <> n%-1 PRINT "," ;
        NEXT
        PRINT
      NEXT n%