Esempio n. 1
0
    private static void test03()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST03 tests SPHERE_ICOS2_POINTS.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    29 August 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        Console.WriteLine("");
        Console.WriteLine("TEST03");
        Console.WriteLine("  SPHERE_ICOS_POINT_NUM \"sizes\" a grid generated");
        Console.WriteLine("  on an icosahedron and projected to a sphere.");
        Console.WriteLine("  SPHERE_ICOS2_POINTS creates the grid.");

        const int factor = 3;

        Console.WriteLine("");
        Console.WriteLine("  Sizing factor FACTOR = " + factor + "");

        int node_num = Icosphere.sphere_icos_point_num(factor);

        Console.WriteLine("");
        Console.WriteLine("  Number of nodes =     " + node_num + "");

        double[] node_xyz = Icosphere.sphere_icos2_points(factor, node_num);

        typeMethods.r8mat_transpose_print_some(3, node_num, node_xyz, 1, 1, 3, 20,
                                               "  Initial part of NODE_XYZ array:");
        //
        //  Write the nodes to a file.
        //
        string filename = "sphere_grid_icos2_points_f" + (factor, "%d")
                          + ".xyz";

        typeMethods.r8mat_write(filename, 3, node_num, node_xyz);

        Console.WriteLine("");
        Console.WriteLine("  Wrote data to \"" + filename + "\"");
    }