diff --git a/src/realtuple.hh b/src/realtuple.hh
index 071c1372b4180882af0ee74c7872275f0ea483c2..c16fe23a727598bdbc7c8b649052000e52ff24c2 100644
--- a/src/realtuple.hh
+++ b/src/realtuple.hh
@@ -41,6 +41,12 @@ public:
         return (a.data_ - b.data_).two_norm();
     }
 
+    /** \brief Compute the gradient of the distance function keeping the first argument fixed
+     */
+    static EmbeddedTangentVector derivativeOfDistanceWRTSecondArgument(const RealTuple& a, const RealTuple& b) {
+        EmbeddedTangentVector gradient = a.data_ - b.data_;
+        return -gradient/distance(a,b);
+    }
     
     /** \brief Write LocalKey object to output stream */
     friend std::ostream& operator<< (std::ostream& s, const RealTuple& realTuple)