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

Home » Public Forums » archive » Re: problem computing area
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: problem computing area [message #68123] Mon, 05 October 2009 17:56 Go to previous message
aetherlux is currently offline  aetherlux
Messages: 12
Registered: July 2006
Junior Member
On Oct 5, 9:02 am, jameskuyper <jameskuy...@verizon.net> wrote:
> aetherlux wrote:
>> Hi everybody,
>
>> I am trying to compute the area of this figure with
>> IDLanROI:ComputeGeometry
>
>> http://juan.gulo.org/area2.png
>
>> but I obtain a negative area. I have checked it and there is not lines
>> crossing over others. For the "horizontal" part of the figure the line
>> begins and finishes in negative values of "y" (that is, the first and
>> last point), but is it a problem?
>
>> Ideas? I have been looking at it all the weekend but I don't have any
>> clue about the possible problem.
>
> A closed planar curve can represent either the area inside the curve,
> or the area outside the curve; the distinction is typically
> represented by listing the points either in the clockwise or counter-
> clockwise order around the curve. I'm not sure which convention is
> used by IDLanROI. The formula usually used for calculating the area
> gives you a positive value when the points are in the correct order,
> and a negative value of the same magnitude when the points are in the
> wrong order. If the number you are getting seems to have the correct
> size, but the wrong sign, you may simply have listed the points on the
> curve in the wrong order.
>
> If the size of the number is wrong, then you have some other problem.
> For instance, the points on the upper parabolic curve must be listed
> in the opposite order of x values, than the points on the bottom
> curve; if the upper one is in the wrong order, you'll get a negative
> number, but one that is not simply the negative of the correct number.
>
> In order to figure out what really is going wrong here, we need to see
> how your code for creating the IDLanROI object - which is what David
> was elliptically referring to.

After applying "reverse" of the x and y vectors I have obtained a
correct positive area. It is weird. I have tested this routine with a
bunch of different contours working in the same way and the area is
positive without need of being counter-clockwise.

So, although I have not a clear idea about what was going wrong, now
it is solved.

Thank you very much.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Slow GUI on linux
Next Topic: Earn Free cash From DoEarn

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

Current Time: Fri Oct 10 11:30:10 PDT 2025

Total time taken to generate the page: 0.48921 seconds