Subject: [Boost-bugs] [Boost C++ Libraries] #13636: distance calculation can be wrong for rings with collinear segments
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-07-17 12:49:55
#13636: distance calculation can be wrong for rings with collinear segments
-------------------------------------------------+-------------------------
Reporter: stfn <p1433025@â¦> | Owner: Barend
| Gehrels
Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
Version: Boost 1.67.0 | Severity: Problem
Keywords: distance ring collinear pythagoras |
segment |
-------------------------------------------------+-------------------------
While unit-testing our code using boost::geometry, I stumbled upon a weird
distance calculation: For two rings that are perfect 2d boxes and share
the orientation and one segment length, their distance is calculated as
zero although they are clearly not intersecting:
https://wandbox.org/permlink/Z9DMLo52IdhZRCFb
I made a rough sketch of the situation:
https://www.desmos.com/calculator/7jbmeu9jqq.
----
Note the line
{{{
// slightly change the values
vehicleRing[2] = Point2D(vehicleRing[2].x() + 1e-10, vehicleRing[2].y() +
1e-10);
}}}
.. changing vehicleRing[0] or vehicleRing[1] also results in zero
distance, whereas slightly moving vehicleRing[2] results in the expected
distance.
----
Sorry for being lazy and not finding a simpler test-case (resp. simpler
numbers), I just copied the values I generated in my own testing pipeline.
-- Ticket URL: <https://svn.boost.org/trac10/ticket/13636> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2018-07-17 12:55:54 UTC