Boost logo

Geometry :

Subject: Re: [geometry] Negative distance?
From: Volker Schöch (vschoech_at_[hidden])
Date: 2012-03-19 06:44:38

Hi Barend,

> Thanks for your report. However, I cannot reproduce it.
> [...] Attached my program to verify this.

I tried your reproduction. It's alright except that your points are based on double. Change that template paramter T of template <typename T> void test_distance() to int and you'll see what I see. It is actually worse (well, different at least) than I thought: The result is not negative, it is "not a number". NaN lets my check for negative results fail, so I prematurely assumed the result was a negative distance. I apologize.

I'm on MSVC++ 10. I tested with boost 1.48.0, my polygon type is oriented counter-clockwise and not closed, my point type is based on int.


Volker Schöch | vschoech_at_[hidden]
Senior Software Engineer
think-cell Software GmbH | Chausseestr. 8/E | 10115 Berlin | Germany | phone +49 30 666473-10 | US phone +1 800 891 8091
Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl

Geometry list run by mateusz at