![](/img/trans.png)
[英]How to set a maximum distance of a Delaunay triangle side in Python
[英]How can I get the nearset point of Delaunay Triangle in Python?
在Matlab中,我可以使用函数DelaunayTri和最近的邻居查找最近的点。 像这样的代码:
X1=[1,2,3,4,5,6,7]';
Y1=[1.3,1.5,1.7,1.9,2.1,2.3,2.5]';
Triangulation=DelaunayTri(Y1, X1);
X2=[1.5,2.5,3.5,4.5,5.5]';
Y2=[1.2,2.2,3.2,4.2,5.2]';
NearInd = nearestNeighbor(Triangulation, Y2, X2);
NearPoint = [X1(NearInd), Y1(NearInd)];
我应该在Python中使用哪个函数来获得相同的结果?
scipy.spatial.Delaunay
模块进行三角剖分。 scipy.spatial.cKDTree
。 这与三角剖分分开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.