From e3eb4bae2cbac767ca1ff106dcbce504fcd0771c Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Fri, 2 Jul 2021 16:35:32 +0300 Subject: [PATCH] Simplify the use of eps_policy in orient2d --- include/boost/geometry/util/precise_math.hpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/include/boost/geometry/util/precise_math.hpp b/include/boost/geometry/util/precise_math.hpp index eccf08800..e14c20fbb 100644 --- a/include/boost/geometry/util/precise_math.hpp +++ b/include/boost/geometry/util/precise_math.hpp @@ -368,28 +368,14 @@ inline RealNumber orient2d(vec2d const& p1, vec2d const& p3, EpsPolicy& eps_policy) { - auto const x = p3.x; - auto const y = p3.y; - - auto const sx1 = p1.x; - auto const sy1 = p1.y; - auto const sx2 = p2.x; - auto const sy2 = p2.y; - - - auto const dx = sx2 - sx1; - auto const dy = sy2 - sy1; - auto const dpx = x - sx1; - auto const dpy = y - sy1; - - eps_policy = EpsPolicy(dx, dy, dpx, dpy); - std::array t1, t2, t3, t4; t1[0] = p1.x - p3.x; t2[0] = p2.y - p3.y; t3[0] = p1.y - p3.y; t4[0] = p2.x - p3.x; + eps_policy = EpsPolicy(t1[0], t2[0], t3[0], t4[0]); + std::array t5_01, t6_01; t5_01[0] = t1[0] * t2[0]; t6_01[0] = t3[0] * t4[0];