我,我试图计算一组点和一个线段之间的最短距离.一切顺利,直到使用来自两组数组的值计算距离,一组用于x距离,一组用于y距离.
计算距离的线是:
d = np.sqrt( dx**2 + dy**2 ).
Run Code Online (Sandbox Code Playgroud)
它告诉我::
ValueError: operands could not be broadcast together with shapes (3312,) (0,)
Run Code Online (Sandbox Code Playgroud)
我之前使用过该脚本的另一组值,它完美无缺.但现在它已不复存在了.我试着找到错误信息的含义但到目前为止还没有成功.有人可以帮忙吗?
python ×1