third_party/blink/renderer/build/scripts/cluster.py
def l2_pairwise_distance(v1, v2):
    """Euclidean distance from each point in v1 to each point in v2

    Args:
        v1: list of point 1
        v2: list of point 2

    Returns:
        distance matrix between each point in v1 and v2
    """
    nrow = len(v1)
    ncol = len(v2)
    dist_mat = [[0 for _ in range(ncol)] for _ in range(nrow)]
    for i in range(nrow):
        for j in range(ncol):
            dist_mat[i][j] = math.sqrt((v1[i] - v2[j])**2)
    return dist_mat
Euclidean distance from each point in v1 to each point in v2

    Args:
        v1: list of point 1
        v2: list of point 2

    Returns:
        distance matrix between each point in v1 and v2
    
Euclidean distance from each point in v1 to each point in v2
Euclidean distance from each point in v1 to each point in v2
def l2_pairwise_distance(v1, v2):
    nrow = len(v1)
    ncol = len(v2)
    dist_mat = [[0 for _ in range(ncol)] for _ in range(nrow)]
    for i in range(nrow):
        for j in range(ncol):
            dist_mat[i][j] = math.sqrt((v1[i] - v2[j])**2)
    return dist_mat
def l2_pairwise_distance ( v1 , v2 ) : nrow = len ( v1 ) ncol = len ( v2 ) dist_mat = [ [ 0 for _ in range ( ncol ) ] for _ in range ( nrow ) ] for i in range ( nrow ) : for j in range ( ncol ) : dist_mat [ i ] [ j ] = math . sqrt ( ( v1 [ i ] - v2 [ j ] ) ** 2 ) return dist_mat
Euclidean distance from each point in v1 to each point in v2
Euclidean distance from each point in v1 to each point in v2
"""Euclidean distance from each point in v1 to each point in v2

    Args:
        v1: list of point 1
        v2: list of point 2

    Returns:
        distance matrix between each point in v1 and v2
    """
distance matrix between each point in v1 and v2
distance matrix between each point in v1 and v2
v1
list of point 1
list of point 1
v2
list of point 2
list of point 2