From f09387fabb463d29e90e6317ab04ebfd4635b0a8 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jul 2014 13:32:24 +0200 Subject: [PATCH] [buffer][fix] Fixed detection of difference spike/continue --- .../geometry/algorithms/detail/buffer/parallel_continue.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/parallel_continue.hpp b/include/boost/geometry/algorithms/detail/buffer/parallel_continue.hpp index be9d2cfad..119d64de7 100644 --- a/include/boost/geometry/algorithms/detail/buffer/parallel_continue.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/parallel_continue.hpp @@ -9,8 +9,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_PARALLEL_CONTINUE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_PARALLEL_CONTINUE_HPP -#include - namespace boost { namespace geometry { @@ -22,8 +20,8 @@ namespace detail { namespace buffer template inline bool parallel_continue(T dx1, T dy1, T dx2, T dy2) { - return math::sign(dx1) == math::sign(dx2) - && math::sign(dy1) == math::sign(dy2); + T const dot = dx1 * dx2 + dy1 * dy2; + return dot > 0; } }} // namespace detail::buffer