I am currently writing a small tool which should help me check whether my manually calculated fourier vectors are correct. Now i need the n-th Root of Unity specified by omega = exp(2*pi*i / n). Can somebody explain me how to represent this omega as a complex in C++?
I am currently writing a small tool which should help me check whether my
Share
Use Euler’s formula:
Then it’s easy:
(replace TWOPI with either a macro available on your system or just the value of 2π however you see fit).