coding Shift_JIS; // 3次元グラフを扱うのに必要 import tool.Graph3D; // サンプル座標値ファイルの書き出し(WRITE_TSVはタブ区切り書き出し) int file = open("sample3d.txt", WRITE_TSV); for(int yi=0; yi<=10; yi++){ for(int xi=0; xi<=10; xi++){ float x = xi * 0.4 - 2.0; // -2.0〜2.0 float y = yi * 0.4 - 2.0; // -2.0〜2.0 float z = y*y - x*x; writeln(file, x, y, z); // ファイルに「 x y z 」の内容で1行書き出す } writeln(file, ""); // 折り返し点で空白行をはさむ } close(file); // 3次元グラフを起動 int graph = newGraph3D(); // ファイルを3次元グラフにプロット setGraph3DFile(graph, "sample3d.txt"); // プロットオプションを設定 setGraph3DOption(graph, "WITH_POINTS", false); // 点プロットをOFF setGraph3DOption(graph, "WITH_MESHES", true); // メッシュプロットをON setGraph3DOption(graph, "WITH_MEMBRANES", true); // 曲面プロットをON