Hi, I am finding area enclosed by convex hull using delayunayt​​riangulat​i​on,,,i have pasted the code...I just need someone to tell me..the area i got is right according to my code?

2 ビュー (過去 30 日間)
theta1=[88,89,90,91,92,94,96,94,90,89,-100,-102,-104,-105,-104,-102,-101,-100];
radius1=[5,7,11,17,26,39,46,44,32,3,0,18,34,32,33,29,28,20];
%subplot(211)
theta_rad=theta1*pi/180;
polar(theta_rad, radius1, 'b*');
hold on;
[x, y] = pol2cart(theta_rad, radius1);
k = convhull(x, y);
xch = x(k);
ych = y(k);
[thetaCH1, rhoCH1] = cart2pol(xch, ych);
%subplot(212)
polar(thetaCH1, rhoCH1, 'ro-');
DT = delaunayTriangulation(theta_rad(:),radius1(:));
[U,v]=convexHull(DT);
i got v=130.8648.... is it the right way to do it ?

採用された回答

John D'Errico
John D'Errico 2017 年 3 月 20 日
NO. You cannot compute a convex hull of your points when they are represented in polar coordinates!!!!! If you did, the result will be nonsensical. And the area it would compute will certainly be nonsense.
Instead, convert the polar coordinates to cartesian coordinates, then compute the area of the convex hull in Cartesian coordiantes:
DT = delaunayTriangulation(x(:),y(:));
[H,A] = convexHull(DT);
A =
390.270316856299
  8 件のコメント
Image Analyst
Image Analyst 2017 年 3 月 21 日
Another quirk of polyarea is that if the perimeter overlaps, you can have a negative area there. For example, the area of a perfect bowtie shape is zero according to polyarea.
L K
L K 2017 年 3 月 21 日
Thank you John & Image analyst...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBounding Regions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by