From octave-sources-request at bevo dot che dot wisc dot edu Wed Apr 14 15:17:01 1999 Subject: Re: comp geom From: doolin at alpha-8 dot CE dot Berkeley dot EDU To: "John W. Eaton" Cc: doolin at alpha-8 dot CE dot Berkeley dot EDU, octave-sources@bevo.che.wisc.edu, doolin@alpha-8.CE.Berkeley.EDU Date: Wed, 14 Apr 1999 13:16:56 -0700 Excellent! My previous code comes directly from some c code. At some point I need centroids too, which I should be able to handle with this. I will repost the modified code then. > >Here is another way to write this that avoids the loop, which may make >it faster if the number of rows of p is large. [] > polyarea ([1,1; -1,1; -1,-1; 1,-1]) ==> 4 > polyarea ([1,1; 1,-1; -1,-1; -1,1]) ==> -4 Yes, point order is important. I will note that in the help part of the comments. Thanks, Dave D > >jwe fwiw, if anyone has any code that will do a delauney triangulation and export to a data file for gnuplot (ie blank line separates triangles) it would save me some time...