求两点之间距离 python

def distance(p1, p2):
    diff = math.sqrt(math.pow((p2[0] - p1[0]), 2) + math.pow((p2[1] - p1[1]), 2))
    return diff

猜你喜欢

转载自blog.csdn.net/stellao_o/article/details/122935359