Exemplo n.º 1
0
    private static void sphere_llq_grid_display_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SPHERE_LLQ_GRID_DISPLAY_TEST tests SPHERE_LLQ_GRID_DISPLAY.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    17 May 2015
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        double[] pc = { 0.0, 0.0, 0.0 };

        const int lat_num  = 10;
        const int long_num = 12;

        const double r = 10.0;

        Console.WriteLine("");
        Console.WriteLine("SPHERE_LLQ_GRID_DISPLAY_TEST");
        Console.WriteLine("  SPHERE_LLQ_GRID_DISPLAY displays an LLQ grid on a sphere.");
        Console.WriteLine("");
        Console.WriteLine("  Number of latitudes is  " + lat_num + "");
        Console.WriteLine("  Number of longitudes is " + long_num + "");
        //
        //  Get points.
        //
        int node_num = Grid_LatLong.sphere_llq_grid_point_count(lat_num, long_num);

        Console.WriteLine("");
        Console.WriteLine("  The number of grid points is " + node_num + "");

        double[] node_xyz = Grid_LatLong.sphere_llq_grid_points(r, pc, lat_num, long_num, node_num);
        //
        //  Get lines.
        //
        int line_num = Grid_LatLong.sphere_llq_grid_line_count(lat_num, long_num);

        Console.WriteLine("");
        Console.WriteLine("  Number of line segments is " + line_num + "");

        int[] line_data = Grid_LatLong.sphere_llq_grid_lines(lat_num, long_num, line_num);

        const string prefix = "sphere_llq_grid";

        Grid_LatLong.sphere_llq_grid_display(node_num, node_xyz, line_num, line_data, prefix);
    }
Exemplo n.º 2
0
    private static void sphere_llq_grid_lines_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SPHERE_LLQ_GRID_LINES_TEST tests SPHERE_LLQ_GRID_LINES.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    17 May 2015
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        const int lat_num  = 3;
        const int long_num = 4;

        Console.WriteLine("");
        Console.WriteLine("SPHERE_LLQ_GRID_LINES_TEST");
        Console.WriteLine("  SPHERE_LLQ_GRID_LINES computes grid lines");
        Console.WriteLine("  on a sphere in 3D.");
        Console.WriteLine("");
        Console.WriteLine("  Number of latitudes is  " + lat_num + "");
        Console.WriteLine("  Number of longitudes is " + long_num + "");

        int line_num = Grid_LatLong.sphere_llq_grid_line_count(lat_num, long_num);

        Console.WriteLine("");
        Console.WriteLine("  Number of line segments is " + line_num + "");

        int[] line_data = Grid_LatLong.sphere_llq_grid_lines(lat_num, long_num, line_num);

        typeMethods.i4mat_transpose_print(2, line_num, line_data,
                                          "  Grid line vertices:");
    }