From: Wood on
Thank you so much....I need to check what I was doing wrong in my calculating....
Now, more important is what is a "principal" square root for a complex number?
sqrt(-1 + 2i) = 0.786151377814533 + 1.27201964947877i , or -0.786151377928752 - 1.27201964940818i
How to determine which is the "principal" square root?
From: Ray Vickson on
On Aug 1, 1:51 am, Wood <wood0...(a)sohu.com> wrote:
> Thank you so much....I need to check what I was doing wrong in my calculating....
> Now, more important is what is a "principal" square root for a complex number?

It is the one having a positive real part (except for the case of z =
- |real|, where the principal square root is i*sqrt(|real|).
Basically, if you use a polar representation z = r*exp(i*t), with r >
0 and -pi < t <= pi, the principal square root is sqrt(r)*exp(i*t/2).
Note that if z =/= -|real|, we have -pi < t < pi, hence cos(t/2) > 0,
meaning that we have a positive real part.

R.G. Vickson


> sqrt(-1 + 2i) = 0.786151377814533 + 1.27201964947877i , or  -0.786151377928752 - 1.27201964940818i
> How to determine which is the "principal" square root?

From: Wood on
I think I can finish the program now.
Thanks a lot for your helps.