Ejemplo n.º 1
0
    private static void test02()

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

        const int factor = 3;

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

        int node_num = Icosphere.sphere_icos_point_num(factor);

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

        double[] node_xyz = Icosphere.sphere_icos1_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_icos1_points_f"
                          + (factor, "%d") + ".xyz";

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

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