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



Task

Given   n,   find the   nth   roots of unity.




import math.{exp, Pi}
 
def rootsOfUnity( n ) = {exp( 2Pi i k/n ) | k <- 0:n}
 
println( rootsOfUnity(3) )