Get the distance beetween 2 nodes

        Args:
            node (object): The other node.
323764
def get_distance(self, node):
        
        delta = (node.pos[0]-self.pos[0], node.pos[1]-self.pos[1])
        return sqrt(delta[0]**2+delta[1]**2)
941202
private double getDistance(TreeNode v, TreeNode w) {
		double sizeOfNodes = getNodeSize(v) + getNodeSize(w);

		double distance = sizeOfNodes / 2
				+ configuration.getGapBetweenNodes(v, w);
		return distance;
	}
146501
def position_node?(node)
      node.respond_to?(:length) &&
        node.length == 2 &&
        node.respond_to?(:all?) &&
        node.all? { |child| child.respond_to?(:to_i) }
    end
1015688
def GetFarthestNode(self, gr, node):
        """"""
        # Remember: weights are negative
        distance = minmax.shortest_path_bellman_ford(gr, node)[1]

        # Find the farthest node, which is end of track
        min_key = None
        for key, value in distance.iteritems():
            if min_key is None or value < distance[min_key]:
                min_key = key

        return min_key
735365
def node_after(node)
      node.parent.equal? self or
        raise ArgumentError, "node is not a child"
      fields = self.fields
      i = node.instance_variable_get(:@parent_field).index + 1
      (i...fields.length).each do |i|
        f = fields[i]
        if f.child? && (val = self.send(f.reader))
          return val
        end
      end
      return nil
    end
243566
@Override
	protected void checkBestDistance(KdTree.Node node, P target) {
		double distanceSq = distance.distance((P)node.point,target);
		if( distanceSq <= bestDistanceSq ) {
			if( bestNode == null || distanceSq < bestDistanceSq ) {
				bestDistanceSq = distanceSq;
				bestNode = node;
			}
		}
	}
981082
def index(self, node: AbstractNode) -> int:
        
        if node in self.childNodes:
            return self.childNodes.index(node)
        elif isinstance(node, Text):
            for i, n in enumerate(self.childNodes):
                # should consider multiple match?
                if isinstance(n, Text) and n.data == node:
                    return i
        raise ValueError('node is not in this node')
412907
def distanceTo(self, tree):
        '''
        
        '''
        return ViewClient.distance(ViewClient.__pickleable(self.views), tree)
721494
def length_from_nodelist(self, nodelist):
        """"""
        cost = 0

        for n1, n2 in zip(nodelist[0:len(nodelist) - 1], nodelist[1:len(nodelist)]):
            cost += self._problem.distance(n1, n2)

        return cost
193822
def project(self, node):
        
        child_object = self.translate(node.child)
        child_object.select_block = str(node.attributes)
        return child_object
1015058
function nodeValue(node1, node2) {
    return (node1.dist + heuristic(node1.point)) - (node2.dist + heuristic(node2.point));
  }
1174769
function(node, l, b, r, t)
{
    return (max(node.bb_r, r) - min(node.bb_l, l))*(max(node.bb_t, t) - min(node.bb_b, b));
}
389704
private double wayLength(List<OSMNode> nodes) {
        double length = 0d;
        OSMNode n1, n2;

        n1 = nodes.get(0);

        for (int i = 1; i < nodes.size(); i++) {
            n2 = nodes.get(i);

            length += LatLongUtil.distance(
                    Double.parseDouble(n1.lat), Double.parseDouble(n1.lon),
                    Double.parseDouble(n2.lat), Double.parseDouble(n2.lon));

            n1 = n2;
        }

        return length;
    }
700205
def get_node(self, node_name):
        """"""
        for node in self.nodes:
            if node.__name__ == node_name:
                return node
159140
def calc_cost(self, node_a, node_b):
        
        if node_b.x - node_a.x == 0 or node_b.y - node_a.y == 0:
            # direct neighbor - distance is 1
            ng = 1
        else:
            # not a direct neighbor - diagonal movement
            ng = SQRT2

        # weight for weighted algorithms
        if self.weighted:
            ng *= node_b.weight

        return node_a.g + ng
968083
function(node1, node2, previousPathLength) {
    var isEverythingDefined =
      node1 != undefined &&
      node2 != undefined &&
      node1.x != undefined &&
      node1.y != undefined &&
      node2.x != undefined &&
      node2.y != undefined;
    if(!isEverythingDefined) {
      return undefined;
    }

    return (previousPathLength || 0) + Math.sqrt(
      Math.pow((node2.y - node1.y), 2) + Math.pow((node2.x - node1.x), 2)
    );
  }
1224982
def describe_node(self, node):
        
        incoming, outgoing, data = self.nodes[node]
        return node, data, outgoing, incoming