![](/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.