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



Task

Given   n,   find the   nth   roots of unity.




// specify polynomial
>> n = 10;
>> a = zeros(1,n+1); a[1] = 1; a[n+1] = -1;
>> polyroots(a)
   radius               roots           success
>> polyroots(a).roots
   -0.309016994 + 0.951056516i
   -0.809016994 + 0.587785252i
          -1 + 5.95570041e-23i
   -0.809016994 - 0.587785252i
   -0.309016994 - 0.951056516i
    0.309016994 - 0.951056516i
    0.809016994 - 0.587785252i
                        1 + 0i
    0.809016994 + 0.587785252i
    0.309016994 + 0.951056516i