comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Calculate convex hull of scattered data?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Calculate convex hull of scattered data? [message #3767] Mon, 13 March 1995 09:26 Go to next message
art.croucher is currently offline  art.croucher
Messages: 11
Registered: March 1995
Junior Member
I'm trying to calculate the convex hull which encloses a scattered data
set. The JHU/APL CONVEXHULL routine didn't work, presumably because
the data set isn't a polygon. Does anyone have a routine that will
calculate either a convex hull or a polygon suitable for input to
CONVEXHULL?

Thanks,

Art Croucher JHU/APL

art.croucher@jhuapl.edu
Re: Calculate convex hull of scattered data? [message #3820 is a reply to message #3767] Fri, 17 March 1995 10:10 Go to previous message
sterner is currently offline  sterner
Messages: 106
Registered: February 1991
Senior Member
art.croucher@jhuapl.edu writes:

> I'm trying to calculate the convex hull which encloses a scattered data
> set. The JHU/APL CONVEXHULL routine didn't work, presumably because
> the data set isn't a polygon. Does anyone have a routine that will
> calculate either a convex hull or a polygon suitable for input to
> CONVEXHULL?

I posted a solution to this but just recieved email from David
Stern with a much simpler and faster solution. Here it is:

------------------------------------------------------------ ----------
I saw your messages RE convex hulls on the newsgroup. The TRIANGULATE
procedure returns the indices of the points on the convex hull as an
optional parameter. It is efficient, O(n log(n)), and simple. Here's
an example:

n = 1000 ;Make some random data
x = randomn(seed, n)
y = randomn(seed, n)

triangulate, x, y, tr, b ;b contains the vertices on the hull
plot, x, y, psym=1
b = [b, b(0)] ;Close the polygon
plots, x(b), y(b) ;Plot the convex hull
end

Hope this helps...
David
------------------------------------------------------------ ----------

I tried 10000 points and it only took a few seconds (unlike my
convexhull routine which takes a few minutes for that number of
points).

Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: ftp://fermi.jhuapl.edu/www/s1r/people/res/res.html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL and ^C under ALPHA/VMS 6.1
Next Topic: Re: idl vs matlab question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 14:20:36 PDT 2025

Total time taken to generate the page: 0.95860 seconds