赞
踩
此示例说明如何计算二维 Delaunay 三角剖分,然后同时对三角剖分以及顶点和三角标签绘图。
rng default
x = rand(10,1);
y = rand(10,1);
dt = delaunayTriangulation(x,y)
dt =
delaunayTriangulation with properties:
Points: [10x2 double]
ConnectivityList: [11x3 double]
Constraints: []
triplot(dt)
在图上显示顶点和三角标签。
hold on
vxlabels = arrayfun(@(n) {sprintf('P%d', n)}, (1:10)');
Hpl = text(x,y,vxlabels,'FontWeight','bold','HorizontalAlignment',...
'center','BackgroundColor','none');
ic = incenter(dt);
numtri = size(dt,1);
trilabels
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。