graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionHeuristicPathFinderAbstract.java
protected double getManhatanHeuristicCost(double x, double y, double gx, double gy, double dFactor) {
        double dx = Math.abs(x - gx);
        double dy = Math.abs(y - gy);
        return dFactor * (dx + dy);
    }
protected double getManhatanHeuristicCost(double x, double y, double gx, double gy, double dFactor) {
        double dx = Math.abs(x - gx);
        double dy = Math.abs(y - gy);
        return dFactor * (dx + dy);
    }
obtains from http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html