Encog.MathUtil.ComplexNumber.Sqrt C# (CSharp) Method

Sqrt() public method

Complex square root (doesn't change this complex number). Computes the principal branch of the square root, which is the value with 0 less equals arg less pi.
public Sqrt ( ) : ComplexNumber
return ComplexNumber
        public ComplexNumber Sqrt()
        {
            double r = Math.Sqrt(Mod());
            double theta = Arg()/2;
            return new ComplexNumber(r*Math.Cos(theta), r*Math.Sin(theta));
        }