docs: public double[][] diff_xy(double matxy[][]) {
  
          mat3 = new double[width][height];
          double Dp;
          double Dm;
  
          for (int i = 0; i < width - 1; i++) {
              for (int j = 0; j < height - 1; j++) {
                  mat1[i][j] = matxy[i + 1][j + 1];
                  mat2[i + 1][j + 1] = matxy[i][j];
                  mat3[i + 1][j] = matxy[i][j + 1];
                  mat4[i][j + 1] = matxy[i + 1][j];
              }
  
          }
  
  
          for (int i = 0; i < width; i++) {
              for (int j = 0; j < height; j++) {
                  if (j == height - 1 && i < width - 1)
                      mat1[i][j] = mat1[i][j - 1];
  
                  else if (i == width - 1)
                      mat1[i][j] = mat1[i - 1][j];
  
  
                  if (i == 0 && j > 0)
                      mat2[i][j] = mat2[1][j];
                  else if (j == 0)
                      mat2[i][0] = mat2[i][1];
  
                  if (i == 0 && j < height - 1)
                      mat3[i][j] = mat3[1][j];
                  else if (j == height - 1)
                      mat3[i][j] = mat3[i][j - 1];
  
                  if (j == 0 && i < width - 1)
                      mat4[i][j] = mat4[i][1];
                  else if (i == width - 1)
                      mat4[i][j] = mat4[i - 1][j];
              }
              mat2[0][0] = mat2[0][1];
          }
  
          for (int i = 0; i < width; i++) {
              for (int j = 0; j < height; j++) {
                  Dp = mat1[i][j] + mat2[i][j];
                  Dm = mat3[i][j] + mat4[i][j];
                  mata[i][j] = ((Dp - Dm) / 4);
              }
          }
  
          return mata;
  
      }