From a48ba4041f840868e5deabef3cfb322d035ef7c4 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 17 Aug 2007 09:39:05 +0000
Subject: [PATCH] bugfix

[[Imported from SVN: r1528]]
---
 src/quaternion.hh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/quaternion.hh b/src/quaternion.hh
index 89af3afc..218df072 100644
--- a/src/quaternion.hh
+++ b/src/quaternion.hh
@@ -310,7 +310,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].
-        T dist = 2*std::acos( diff[3]);
+        T dist = 2*std::acos( std::min(diff[3],1.0) );
 
         T invSinc = 1/sincHalf(dist);
 
-- 
GitLab