Esempio n. 1
0
    private static void test01()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST01 tests SPHERE_ICOS_POINT_NUM.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    29 August 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int edge_num;
        int factor;
        int factor_log;
        int node_num;
        int triangle_num;

        Console.WriteLine("");
        Console.WriteLine("TEST01");
        Console.WriteLine("  SPHERE_ICOS_POINT_NUM determines the size");
        Console.WriteLine("  (number of vertices, edges and faces) in a grid");
        Console.WriteLine("  on a sphere, made by subdividing an initial");
        Console.WriteLine("  projected icosahedron.");
        Console.WriteLine("");
        Console.WriteLine("  N determines the number of subdivisions of each");
        Console.WriteLine("  edge of the icosahedral faces.");
        Console.WriteLine("");
        Console.WriteLine("         N         V         E         F");
        Console.WriteLine("  --------  --------  --------  --------");
        Console.WriteLine("");

        for (factor = 1; factor <= 20; factor++)
        {
            node_num     = Icosphere.sphere_icos_point_num(factor);
            edge_num     = Icosphere.sphere_icos_edge_num(factor);
            triangle_num = Icosphere.sphere_icos_face_num(factor);
            Console.WriteLine("  " + factor.ToString().PadLeft(8)
                              + "  " + node_num.ToString().PadLeft(8)
                              + "  " + edge_num.ToString().PadLeft(8)
                              + "  " + triangle_num.ToString().PadLeft(8) + "");
        }

        Console.WriteLine("");
        Console.WriteLine("  Repeat, but using N constrained by doubling:");
        Console.WriteLine("");
        Console.WriteLine("         N         V         E         F");
        Console.WriteLine("  --------  --------  --------  --------");
        Console.WriteLine("");

        factor = 1;
        for (factor_log = 0; factor_log <= 10; factor_log++)
        {
            node_num     = Icosphere.sphere_icos_point_num(factor);
            edge_num     = Icosphere.sphere_icos_edge_num(factor);
            triangle_num = Icosphere.sphere_icos_face_num(factor);
            Console.WriteLine("  " + factor.ToString().PadLeft(8)
                              + "  " + node_num.ToString().PadLeft(8)
                              + "  " + edge_num.ToString().PadLeft(8)
                              + "  " + triangle_num.ToString().PadLeft(8) + "");
            factor *= 2;
        }
    }