code: private boolean assignFlowDirection( GridNode current, GridNode diagonal, GridNode node1, GridNode node2 ) {
          double diagonalSlope = abs(current.getSlopeTo(diagonal));
          if (node1 != null) {
              double tmpSlope = abs(diagonal.getSlopeTo(node1));
              if (diagonalSlope < tmpSlope) {
                  return false;
              }
          }
          if (node2 != null) {
              double tmpSlope = abs(diagonal.getSlopeTo(node2));
              if (diagonalSlope < tmpSlope) {
                  return false;
              }
          }
          return true;
      }
docs: Checks if the path from the current to the first node is steeper than to the others.
  
  @param current the current node.
  @param diagonal the diagonal node to check.
  @param node1 the first other node to check.
  @param node2 the second other node to check.
  @return <code>true</code> if the path to the first node is steeper in module than
  that to the others.