Beispiel #1
0
        public static Complex Ln(Complex c)
        {
            /*if (c.IsReal() && c < 0.0) return Ln(-c) + (Constants.I * Constants.Pi);
            if (c.IsReal()) return Quad.Log(c.Real);

            return Math.Log(c.Module, Constants.E) + (Constants.I * (Complex)c.Argument);*/

            if(c.IsRealNonNegative()) return new Complex(Math.Log(c.Real, Constants.E), 0.0);
            return new Complex(0.5 * Math.Log(c.MagnitudeSquared(), Constants.E), c.Argument);
        }