太难找了,自己写个博客记录一下
hypot()方法返回的欧几里德范数 sqrt(xx + yy).
import math
len = math.hypot(x1-x2, y1-y2) #(x1, y1)与(x2, y2)间的欧氏距离
np.linalg.norm([x1, y1] - [x2, y2])
参考:
https://www.jb51.net/article/66227.htm
太难找了,自己写个博客记录一下
hypot()方法返回的欧几里德范数 sqrt(xx + yy).
import math
len = math.hypot(x1-x2, y1-y2) #(x1, y1)与(x2, y2)间的欧氏距离
np.linalg.norm([x1, y1] - [x2, y2])
参考:
https://www.jb51.net/article/66227.htm