From e00c142242bb84af99d881590935ab5fea9419c6 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 19 Sep 2014 18:39:45 +0000 Subject: [PATCH] Implement 'log', the inverse of 'exp' [[Imported from SVN: r9886]] --- dune/gfe/unitvector.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dune/gfe/unitvector.hh b/dune/gfe/unitvector.hh index f37fa4d9..63ce6f72 100644 --- a/dune/gfe/unitvector.hh +++ b/dune/gfe/unitvector.hh @@ -152,6 +152,14 @@ public: return result; } + static EmbeddedTangentVector log(const UnitVector& p, const UnitVector& q) + { + EmbeddedTangentVector result = p.projectOntoTangentSpace(q.data_-p.data_); + if (result.two_norm() > 1e-10) + result *= distance(p,q) / result.two_norm(); + return result; + } + /** \brief Length of the great arc connecting the two points */ static T distance(const UnitVector& a, const UnitVector& b) { -- GitLab