重み付きvoronoi(ボロノイ)図の作成方法

7 vues (au cours des 30 derniers jours)
takumi
takumi le 1 Sep 2024
重み付きVoronoi図の作成方法について質問です.
以下のように母点が必ずボロノイ境界内にあるように処理したコードを書きました.
ここから重み付きVoronoi図を作成する方法をご存じの方おりましたらご教授願います.
clc,clear,close all
P=[1 2 4 10 7;4 5 9 6 3]'; %母点
%母点がボロノイ境界内にあるように処理
space=0.5;
min_x=min(P(:,1))-space;
min_y=min(P(:,2))-space;
max_x=max(P(:,1))+space;
max_y=max(P(:,2))+space;
range_x=max_x-min_x;
range_y=max_y-min_y;
mar=range_x+range_y;
cx=(min_x+max_x/2);
cy=(min_y+max_y/2);
nP=[P; min_x - mar, cy; max_x + mar, cy; cx, min_y - mar; cx, max_y + mar];
[Vx Vy]=voronoi(nP(:,1),nP(:,2));
plot(Vx,Vy,'k')

Réponses (0)

Catégories

En savoir plus sur ボロノイ線図 dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!