From 08f3789c0139dd6ddbb91c460cd3e93ffdaaa888 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 25 May 2020 21:02:36 +0200 Subject: [PATCH] #5899 Fracture: Make sure the angle is in 0..90 interval --- ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp index ec79ce4c12..8fdaed3d41 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp @@ -401,9 +401,10 @@ double RimFracture::wellFractureAzimuthDiff() const double angle1 = wellAzimuthAtFracturePosition(); double angle2 = m_azimuth; - double smallestDiffDegrees = getAbsoluteDiff2Angles( angle1, angle2, 180.0 ); + double diffDegrees = getAbsoluteDiff2Angles( angle1, angle2, 180.0 ); + double smallesDiffDegrees = std::min( 180.0 - diffDegrees, diffDegrees ); - return smallestDiffDegrees; + return smallesDiffDegrees; } //--------------------------------------------------------------------------------------------------