Beispiel #1
0
        public static MultiPrecision <N> EllipticPi(MultiPrecision <N> n, MultiPrecision <N> k)
        {
            if (!k.IsFinite || k.Sign == Sign.Minus || k > One || n > One)
            {
                return(NaN);
            }

            if (n.IsZero)
            {
                return(EllipticK(k));
            }

            if (n == One)
            {
                return(PositiveInfinity);
            }

            if (k.IsZero)
            {
                return(PI / (2 * Sqrt(1 - n)));
            }

            if (k == One)
            {
                return(PositiveInfinity);
            }

            MultiPrecision <N> y = MultiPrecision <Plus1 <N> > .EllipticPiCore(n.Convert <Plus1 <N> >(), k.Convert <Plus1 <N> >()).Convert <N>();

            return(y);
        }