From 55969fb2979ea6ca662144e09f440120f01f9834 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 10 Feb 2010 21:41:14 +0000
Subject: [PATCH] implement the Riemannian distance

[[Imported from SVN: r5530]]
---
 src/unitvector.hh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/unitvector.hh b/src/unitvector.hh
index e2fbdf17..200dfd48 100644
--- a/src/unitvector.hh
+++ b/src/unitvector.hh
@@ -18,6 +18,11 @@ public:
         return *this;
     }
 
+    /** \brief Length of the great arc connecting the two points */
+     static double distance(const UnitVector& a, const UnitVector& b) {
+        return std::acos(a.data_ * b.data_);
+    }
+
     /** \brief Write LocalKey object to output stream */
     friend std::ostream& operator<< (std::ostream& s, const UnitVector& unitVector)
     {
-- 
GitLab