Polyarea function concave or convex

4 visualizaciones (últimos 30 días)
ho mark
ho mark el 29 de Dic. de 2016
Editada: John D'Errico el 29 de Dic. de 2016
I want to know whether the built in function polyarea finds the area of data points bounded by concavehull or not. If it is bounded by convex hull, It would really affect the accuracy of my result.

Respuestas (2)

John D'Errico
John D'Errico el 29 de Dic. de 2016
Editada: John D'Errico el 29 de Dic. de 2016
polyarea allows completely general polygons. It does NOT give you the convex hull area. (This is 100% certain.) But, since nobody should ever believe the line "just trust me", trust MATLAB instead:
Here is a polygon with known zero area, because it traces around 3 vertices, but then retraces its path. The area of the convex hull would be 1/2.
py = [0 1 1 1 0];
px = [0 0 1 0 0];
polyarea(px,py)
ans =
0
Yet polyarea gives the correct answer of zero.

Matt J
Matt J el 29 de Dic. de 2016
An easy way to check is to compare with convhulln. Convhulln definitely computes the area of the convex hull. I don't see why polyarea would exist if it is redundant with convhulln.

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by