output of delaunay triangulation

1 回表示 (過去 30 日間)
GURUPRIYA
GURUPRIYA 2014 年 2 月 26 日
回答済み: Naga 2024 年 9 月 27 日
After applying delaunay triangulation how is it possible to calculate area of each triangles found?how to find the vertices of the triangles.HELP us with matlab code. Thank you,

回答 (1 件)

Naga
Naga 2024 年 9 月 27 日
Hello Gurupriya,
Use the code below to calculate the area of each triangle from a Delaunay triangulation:
dt = delaunayTriangulation(X);
triangles = dt.ConnectivityList;
triangleAreas = zeros(size(triangles, 1), 1);
for i = 1:size(triangles, 1)
tri = triangles(i, :);
v = X(tri, :);
triangleAreas(i) = 0.5 * abs(det([v(1,:) 1; v(2,:) 1; v(3,:) 1]));
end
disp('Areas of each triangle:');
disp(triangleAreas);
'ConnectivityList' property returns an array where each row contains the indices of the vertices that form a triangle. Please refer to the below documentation for more information on the same:

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by