Artemis.Engine.Maths.SpecialFunctions.YN C# (CSharp) Method

YN() public static method

Returns the Bessel function of the second kind, of order n of the specified number.
public static YN ( int n, double x ) : double
n int
x double
return double
        public static double YN(int n, double x)
        {
            double by, bym, byp, tox;

            if (n == 0) return Y0(x);
            if (n == 1) return Y1(x);

            tox = 2.0/x;
            by = Y1(x);
            bym = Y0(x);
            for (int j = 1; j < n; j++)
            {
                byp = j*tox*by - bym;
                bym = by;
                by = byp;
            }
            return by;
        }