From a8b1803d1295713fa669edb35330ceba8f5e3f01 Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@mi.fu-berlin.de> Date: Thu, 3 Nov 2011 15:34:50 +0000 Subject: [PATCH] some improvement in the distance computation. Patch by Oliver Sander [[Imported from SVN: r8105]] --- dune/gfe/rotation.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh index 75e4f14b..1f00b6ed 100644 --- a/dune/gfe/rotation.hh +++ b/dune/gfe/rotation.hh @@ -532,9 +532,7 @@ public: // Compute the geodesical distance between a and b on SO(3) // Due to numerical dirt, diff[3] may be larger than 1. // In that case, use 1 instead of diff[3]. - return (diff[3] > 1.0) - ? 0 - : 2*std::acos( std::min(diff[3],1.0) ); + return 2*std::acos( std::min(diff[3],1.0) ); } /** \brief Compute the vector in T_aSO(3) that is mapped by the exponential map @@ -556,7 +554,7 @@ public: } else { - T dist = 2*std::acos( std::min(diff[3],1.0) ); + T dist = 2*std::acos( diff[3] ); T invSinc = 1/sincHalf(dist); -- GitLab