coding UTF-8; // Required to handle 3D graphs import tool.Graph3D; // Prepare sample coordinate arrays to plot float xData[11][11]; float yData[11][11]; float zData[11][11]; for(int yi=0; yi<=10; yi++){ for(int xi=0; xi<=10; xi++){ float x = xi * 0.4 - 2.0; // from -2.0 to 2.0 float y = yi * 0.4 - 2.0; // from -2.0 to 2.0 float z = y*y - x*x; xData[yi][xi] = x; yData[yi][xi] = y; zData[yi][xi] = z; } } // Launch the 3D graph int graph = newGraph3D(); // Plot the coordinate arrays on the 3D graph setGraph3DData(graph, xData, yData, zData); // Set plot options setGraph3DOption(graph, "WITH_POINTS", false); // Disable point plot setGraph3DOption(graph, "WITH_MESHES", true); // Enable mesh plot setGraph3DOption(graph, "WITH_MEMBRANES", true); // Enable surface plot