## Re: [Vxl-users] Problem correctly using vgl_area

 Re: [Vxl-users] Problem correctly using vgl_area From: Peter Vanroose - 2010-07-24 17:13:37 Attachments: Message as HTML ```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 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. ```

 [Vxl-users] Problem correctly using vgl_area From: Nathaniel Bird - 2010-07-23 21:59:37 Attachments: Message as HTML ```Greetings all, 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. Thank you all for your time, -Nate ```
 Re: [Vxl-users] Problem correctly using vgl_area From: Peter Vanroose - 2010-07-24 17:13:37 Attachments: Message as HTML ```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 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. ```
 Re: [Vxl-users] Problem correctly using vgl_area From: Nate Bird - 2010-07-26 22:51:14 Attachments: Message as HTML ```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 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 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. > > > > > > > > ```