public static void legendre_associated_normalized_sphere_values_test()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    LEGENDRE_ASSOCIATED_NORMALIZED_SPHERE_VALUES_TEST tests LEGENDRE_ASSOCIATED_NORMALIZED_SPHERE_VALUES.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    12 March 2012
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        double fx = 0;
        int    m  = 0;
        int    n  = 0;
        double x  = 0;

        Console.WriteLine("");
        Console.WriteLine("LEGENDRE_ASSOCIATED_NORMALIZED_SPHERE_VALUES_TEST:");
        Console.WriteLine("  LEGENDRE_ASSOCIATED_NORMALIZED_SPHERE_VALUES stores values of");
        Console.WriteLine("  the associated Legendre polynomials, ref normalized for the unit sphere.");
        Console.WriteLine("");
        Console.WriteLine("     N     M    X             P(N,M)(X)");
        Console.WriteLine("");
        int n_data = 0;

        for (;;)
        {
            Legendre.legendre_associated_normalized_sphere_values(ref n_data, ref n, ref m, ref x, ref fx);
            if (n_data == 0)
            {
                break;
            }

            Console.WriteLine("  "
                              + n.ToString(CultureInfo.InvariantCulture).PadLeft(6) + "  "
                              + m.ToString(CultureInfo.InvariantCulture).PadLeft(6) + "  "
                              + x.ToString(CultureInfo.InvariantCulture).PadLeft(12) + "  "
                              + fx.ToString("0.################").PadLeft(24) + "");
        }
    }