Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81580 - in trunk: boost/geometry/algorithms libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2012-11-26 17:12:36


Author: barendgehrels
Date: 2012-11-26 17:12:35 EST (Mon, 26 Nov 2012)
New Revision: 81580
URL: http://svn.boost.org/trac/boost/changeset/81580

Log:
[geometry] fixed comparable_distance point-linestring (and -range, -polygon)
Text files modified:
   trunk/boost/geometry/algorithms/distance.hpp | 5 ++++-
   trunk/libs/geometry/test/algorithms/comparable_distance.cpp | 8 ++++----
   2 files changed, 8 insertions(+), 5 deletions(-)

Modified: trunk/boost/geometry/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/algorithms/distance.hpp 2012-11-26 17:12:35 EST (Mon, 26 Nov 2012)
@@ -369,7 +369,10 @@
                     <
                         segment_tag,
                         Point,
- typename point_type<Linestring>::type
+ typename point_type<Linestring>::type,
+ typename cs_tag<Point>::type,
+ typename cs_tag<typename point_type<Linestring>::type>::type,
+ Strategy
>::type ps_strategy_type;
 
         return detail::distance::point_to_range

Modified: trunk/libs/geometry/test/algorithms/comparable_distance.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/comparable_distance.cpp (original)
+++ trunk/libs/geometry/test/algorithms/comparable_distance.cpp 2012-11-26 17:12:35 EST (Mon, 26 Nov 2012)
@@ -102,11 +102,11 @@
     P p = bg::make<P>(2, 1);
 
     typename bg::coordinate_type<P>::type d = bg::comparable_distance(p, points);
- BOOST_CHECK_CLOSE(d, 0.70710678, 0.001);
+ BOOST_CHECK_CLOSE(d, 0.5, 0.001);
 
     p = bg::make<P>(5, 5);
     d = bg::comparable_distance(p, points);
- BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+ BOOST_CHECK_CLOSE(d, 8.0, 0.001);
 
 
     bg::model::linestring<P> line;
@@ -117,11 +117,11 @@
     p = bg::make<P>(5, 5);
 
     d = bg::comparable_distance(p, line);
- BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+ BOOST_CHECK_CLOSE(d, 8.0, 0.001);
 
     // Reverse case
     d = bg::comparable_distance(line, p);
- BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+ BOOST_CHECK_CLOSE(d, 8.0, 0.001);
 }
 
 template <typename P>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk