diff --git a/src/realtuple.hh b/src/realtuple.hh index 6dd1157b17c35b860bb0cf63d91180e715767c16..f4368b1db6d4a11326531e7e1d4a6d3ff04aa4c5 100644 --- a/src/realtuple.hh +++ b/src/realtuple.hh @@ -17,6 +17,8 @@ public: typedef Dune::FieldVector<double,N> EmbeddedTangentVector; + typedef Dune::FieldVector<double,N> TangentVector; + /** \brief Default constructor */ RealTuple() {} @@ -26,6 +28,17 @@ public: { data_.assign(v); } + + /** \brief Geodesic distance between two points + + Simply the Euclidean distance */ + static double distance(const RealTuple& a, const RealTuple& b) { + double result = 0; + for (int i=0; i<N; i++) + result += (a.data_[0] - b.data_[0]) * (a.data_[0] - b.data_[0]); + return std::sqrt(result); + } + /** \brief Write LocalKey object to output stream */ friend std::ostream& operator<< (std::ostream& s, const RealTuple& realTuple)