#NEWLINE# def point_dist_d2( arr , p1 , p2 ) : #NEWLINE# #INDENT# 'Returns an array of the distance between two points in an array of 2d points' #NEWLINE# return numpy . sqrt ( ( numpy . square ( ( arr [ : , p1 , 0 ] - arr [ : , p2 , 0 ] ) ) + numpy . square ( ( arr [ : , p1 , 1 ] - arr [ : , p2 , 1 ] ) ) ) )