### Question:
TriangleUtils { public static double[][] gridDataLinear(final double[][] x_in, final double[][] y_in, final double[][] z_in, final Window window, final double xyRatio, final int xScale, final int yScale, final double nodata, final int offset) throws Exception { final FastDelaunayTriangulator FDT = triangulate(x_in, y_in, z_in, xyRatio); return interpolate(xyRatio, window, xScale, yScale, offset, nodata, FDT); }  static double[][] gridDataLinear(final double[][] x_in, final double[][] y_in, final double[][] z_in,
                                            final Window window, final double xyRatio, final int xScale,
                                            final int yScale, final double nodata, final int offset);  }### Answer:
@Test public void testGridDataLinear() throws Exception { final double DELTA_06 = 1e-06; Window tileWin = new Window(10000, 10127, 1500, 2011); int mlL = 1; int mlP = 1; double r_az_ratio = 5.2487532186594095; int offset = 0; double NODATA = -32768; final int nRows = 418; final int nCols = 532; double[][] DEMline_buffer; double[][] DEMpixel_buffer; double[][] input_buffer; double[][] grd_EXPECTED; String testDataDir = "/d2/etna_test/demTest/"; String bufferFileName; bufferFileName = testDataDir + "dem_line_buffer.r8.swap"; DEMline_buffer = readDoubleData(bufferFileName, nRows, nCols).toArray2(); bufferFileName = testDataDir + "dem_pixel_buffer.r8.swap"; DEMpixel_buffer = readDoubleData(bufferFileName, nRows, nCols).toArray2(); bufferFileName = testDataDir + "dem_buffer.r8.swap"; input_buffer = readDoubleData(bufferFileName, nRows, nCols).toArray2(); bufferFileName = testDataDir + "output_buffer.r8.swap"; grd_EXPECTED = readDoubleData(bufferFileName, 128, 512).toArray2(); long t0 = System.currentTimeMillis(); double[][] grd_ACTUAL = TriangleUtils.gridDataLinear(DEMline_buffer, DEMpixel_buffer, input_buffer, tileWin, r_az_ratio, mlL, mlP, NODATA, offset); long t1 = System.currentTimeMillis(); System.out.println("Data set gridded in " + (0.001 * (t1 - t0)) + " sec"); for (int i = 0; i < grd_EXPECTED.length; i++) { double[] doubles = grd_EXPECTED[i]; Assert.assertArrayEquals(doubles, grd_ACTUAL[i], DELTA_06); } }