Okay, so this is bugging me now.
I know this:
while tg angle = Y / X
for y > 0, angle is an element of < 0, PI >
for y < 0, angle is an element of < PI, 2PI >
for y = 0, angle is 0 or PI or 2PI.
Okay, but how to determine what out of those 3 values angle actually is ?
So far this is what I know:
If X is negative, angle should be PI, and if X is positive, angle should be either 0 or 2PI... And thats bugging me now, how do I know if its 2PI or 0 ?
EDIT:
I am asking this because if I assume that angle is 0, while calculating root of complex number I would use:
r * cis ((0 + 2*k*PI) / n)
and if I assume that angle is 2PI, it would be
r * cis ((2PI + 2*k*PI) / n)
What should I assume my angle is when y = 0 and x > 0 ?:/
If you replace k in the second expression by k-1, you will get the first expression for r*cis.