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

Home » Public Forums » archive » Re: pollyfillv, area of a blob, etc...
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
Re: pollyfillv, area of a blob, etc... [message #59578] Thu, 03 April 2008 07:16 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JP writes:

> by the way, I would be happy if at least I could calculate the
> centroid of each polygon and then get the array index for each
> centroid.

I suppose the centroid of the polygon is the average
value of it vertices, or maybe the mean if you didn't
want to overbias outliers. In your case, you could
probably just pick a vertex and be pretty darn close
to it. :-)

> But I don't know how to calculate the centroid (Coyote's procedure
> CENTROID works with an array, not with a polygon).
>
> And if I had the centroid, how do I easily get the array index?

ROUND would probably work. :-)

Or, if you polygons were in some other coordinate system,
you will have to convert from that system to device coordinates.
CONVERT_COORD will be helpful.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: pollyfillv, area of a blob, etc... [message #59580 is a reply to message #59578] Wed, 02 April 2008 23:38 Go to previous messageGo to next message
JP is currently offline  JP
Messages: 55
Registered: April 2008
Member
It's me again...

by the way, I would be happy if at least I could calculate the
centroid of each polygon and then get the array index for each
centroid.

But I don't know how to calculate the centroid (Coyote's procedure
CENTROID works with an array, not with a polygon).

And if I had the centroid, how do I easily get the array index?

thanks again.

JP
Re: pollyfillv, area of a blob, etc... [message #59664 is a reply to message #59578] Thu, 03 April 2008 16:08 Go to previous message
JP is currently offline  JP
Messages: 55
Registered: April 2008
Member
On Apr 4, 1:16 am, David Fanning <n...@dfanning.com> wrote:
> I suppose the centroid of the polygon is the average
> value of it vertices, or maybe the mean if you didn't
> want to overbias outliers.

I guess you meant "the average value of it vertices, or maybe the
MEDIAN" ??

In any case, thank you. I didn't realize that the centroid is just the
mean of the vertices in the two dimensions.
I'll solve my problem that way.

Cheers,

JP
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to compute the merged volume of two 3D objects
Next Topic: IDL 7.0 Java connector

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

Current Time: Wed Oct 08 13:34:35 PDT 2025

Total time taken to generate the page: 0.00654 seconds