Questions about the Detailed Settings of Voronoi Diagrams ボロノイ図の細かな設定について質問です
I have been reading an example from a book and am trying to recreate the diagram using Voronoi diagrams. However, I want to consider a bounded region [0,1], [1,0], but when using the voronoi function, the lines extend beyond the boundaries. I would like to obtain information such as the area and centroid of the bounded regions, so I want to create the Voronoi diagram with these bounded constraints in mind. Is this possible?
ある書籍の例を読み、ボロノイ図を用いてその図を再現したいと考えています。
しかし有界の領域[0,1],[1,0]について考えたいところ、voronoiでは枠外を超えて線が伸びてしまいます。
有界領域の面積や重心などの情報を得たいため、ボロノイ図を有界の制約を踏まえて作成したいのですが可能でしょうか?
clear
close all
figure()
x = [0.2 0.6 0.9 0.7 0.8 0.5 0.4 0.1 0.3 0.5];
y = [0.7 0.9 0.8 0.6 0.3 0.4 0.2 0.1 0.3 0.5];
X = [x’,y’];
vrn_obj = voronoi(X(:,1),X(:,2));
[vx,vy] = voronoi(X(:,1),X(:,2));
edge_set =[vx’,vy’];
nump = size(X,1);
plabels = arrayfun(@(n) {sprintf(‘X%d’, n)}, (1:nump)’);
hold on
Hpl = text(X(:,1), X(:,2), plabels, ‘FontWeight’, …
‘bold’, ‘HorizontalAlignment’,’center’, …
‘BackgroundColor’, ‘none’);
dt = delaunayTriangulation(X);
hold on
triplot(dt,’–‘);
hold off
axis equal
% xlim([0 1])
% ylim([0 1])
grid onI have been reading an example from a book and am trying to recreate the diagram using Voronoi diagrams. However, I want to consider a bounded region [0,1], [1,0], but when using the voronoi function, the lines extend beyond the boundaries. I would like to obtain information such as the area and centroid of the bounded regions, so I want to create the Voronoi diagram with these bounded constraints in mind. Is this possible?
ある書籍の例を読み、ボロノイ図を用いてその図を再現したいと考えています。
しかし有界の領域[0,1],[1,0]について考えたいところ、voronoiでは枠外を超えて線が伸びてしまいます。
有界領域の面積や重心などの情報を得たいため、ボロノイ図を有界の制約を踏まえて作成したいのですが可能でしょうか?
clear
close all
figure()
x = [0.2 0.6 0.9 0.7 0.8 0.5 0.4 0.1 0.3 0.5];
y = [0.7 0.9 0.8 0.6 0.3 0.4 0.2 0.1 0.3 0.5];
X = [x’,y’];
vrn_obj = voronoi(X(:,1),X(:,2));
[vx,vy] = voronoi(X(:,1),X(:,2));
edge_set =[vx’,vy’];
nump = size(X,1);
plabels = arrayfun(@(n) {sprintf(‘X%d’, n)}, (1:nump)’);
hold on
Hpl = text(X(:,1), X(:,2), plabels, ‘FontWeight’, …
‘bold’, ‘HorizontalAlignment’,’center’, …
‘BackgroundColor’, ‘none’);
dt = delaunayTriangulation(X);
hold on
triplot(dt,’–‘);
hold off
axis equal
% xlim([0 1])
% ylim([0 1])
grid on I have been reading an example from a book and am trying to recreate the diagram using Voronoi diagrams. However, I want to consider a bounded region [0,1], [1,0], but when using the voronoi function, the lines extend beyond the boundaries. I would like to obtain information such as the area and centroid of the bounded regions, so I want to create the Voronoi diagram with these bounded constraints in mind. Is this possible?
ある書籍の例を読み、ボロノイ図を用いてその図を再現したいと考えています。
しかし有界の領域[0,1],[1,0]について考えたいところ、voronoiでは枠外を超えて線が伸びてしまいます。
有界領域の面積や重心などの情報を得たいため、ボロノイ図を有界の制約を踏まえて作成したいのですが可能でしょうか?
clear
close all
figure()
x = [0.2 0.6 0.9 0.7 0.8 0.5 0.4 0.1 0.3 0.5];
y = [0.7 0.9 0.8 0.6 0.3 0.4 0.2 0.1 0.3 0.5];
X = [x’,y’];
vrn_obj = voronoi(X(:,1),X(:,2));
[vx,vy] = voronoi(X(:,1),X(:,2));
edge_set =[vx’,vy’];
nump = size(X,1);
plabels = arrayfun(@(n) {sprintf(‘X%d’, n)}, (1:nump)’);
hold on
Hpl = text(X(:,1), X(:,2), plabels, ‘FontWeight’, …
‘bold’, ‘HorizontalAlignment’,’center’, …
‘BackgroundColor’, ‘none’);
dt = delaunayTriangulation(X);
hold on
triplot(dt,’–‘);
hold off
axis equal
% xlim([0 1])
% ylim([0 1])
grid on plot, matlab, graph MATLAB Answers — New Questions