Greetings once again,

Here is my follow up:  I downloaded the latest version of the VXL source from SVN today, and compiled it into both Release and Debug. 

With the libraries compiled in release mode, both calls to vgl_area still return 0.0.

However, with the libraries compiled in debug mode, the calls to vgl_area return the correct result.

I can simply using the version of the libraries I compiled in debug mode, but would rather not.  Why this would cause problems is beyond me.  If anyone has any ideas, please let me know.

Thank you once again,

-Nate


On Sat, Jul 24, 2010 at 12:13 PM, Peter Vanroose <peter_vanroose@yahoo.co.uk> wrote:
Works for me, i.e., both vgl_area calls return 19*19.
I've added your code as a new test in vgl/tests/test_area.cxx as test_simple3().

-- Peter. 
Nathaniel Bird <nathaniel.bird@gmail.com> wrote:

I am having a problem properly using the vgl_area function on a vgl_polygon< double> type.  Every time I call the function, it returns an area of 0.0.

Here is some example code that causes this problem for me:

    double x[ 4]= { 1.0, 20.0, 20.0, 1.0};
    double y[ 4]= { 1.0, 1.0, 20.0, 20.0};
    unsigned int size= 4;

    vgl_polygon< double> poly;
    poly.new_sheet();
    poly[ 0].resize( size);
    for( unsigned int ii= 0; ii< size; ++ii) {
        poly[ 0][ ii].set( x[ ii], y[ ii]);
    }

    double area= vgl_area( poly);  // Always returns 0.0
    double area2= vgl_area_signed( poly);  // Also always returns 0.0

I am using Microsoft Visual Studio 2008, with VXL version 1.14.0.  If anyone can let me know what I am doing wrong, I would be very grateful.