unit5_pp/scripts/gradient_descent_solution.py
def euclidean_distance(index_a, index_b, map_width):
    """
    Euclidean distance between grid cells provided as linear indexes on a flat map
    """
    a = indexToGridCell(index_a, map_width)
    b = indexToGridCell(index_b, map_width)

    return ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5

    Euclidean distance between grid cells provided as linear indexes on a flat map
    
Euclidean distance between grid cells provided as linear indexes on a flat map
Euclidean distance between grid cells provided as linear indexes on a flat map
def euclidean_distance(index_a, index_b, map_width):
    a = indexToGridCell(index_a, map_width)
    b = indexToGridCell(index_b, map_width)
    return ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
def euclidean_distance ( index_a , index_b , map_width ) : a = indexToGridCell ( index_a , map_width ) b = indexToGridCell ( index_b , map_width ) return ( ( a [ 0 ] - b [ 0 ] ) ** 2 + ( a [ 1 ] - b [ 1 ] ) ** 2 ) ** 0.5
Euclidean distance between grid cells provided as linear indexes on a flat map
Euclidean distance between grid cells provided as linear indexes on a flat map
"""
    Euclidean distance between grid cells provided as linear indexes on a flat map
    """
index_a
index_b
map_width