[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Polygon hull
- Subject: Polygon hull
- From: bcohen(at)lpl.arizona.edu (Barbara A Cohen)
- Date: 17 Dec 2000 21:51:56 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: The University of Arizona
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:22658
Hi, I have an array of data and I want to plot a polygon that encompasses
all the points within it. I have tried JHU's convexhull but it fails to
encompass all the data (example below). Does anyone else have a program
to do this? I thought I'd ask before trying it myself :) Thanks! Barbara
Example of how convexhull fails in this case:
x=[0.36,0.35,0.39,0.42,0.60,0.41,0.48,0.73,0.46,0.42,0.42,0.42,0.47,0.44,0.47,0.49,0.54,0.64,0.65]
y=[0.19,0.26,0.26,0.26,0.14,0.22,0.15,0.10,0.16,0.30,0.27,0.27,0.23,0.23,0.22,0.16,0.16,0.08,0.08]
plot, x, y, color=0, /nodata
convexhull, x, y, xh, yh
polyfill, xh, yh, color=150, fill_pattern=50
plot, x, y, psym=7, color=0
--