From: hartmann Date: Wed, 6 Sep 2000 11:09:23 +0000 (+0000) Subject: Implemenation of new function Point::distance (const Point &p) X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13348882e14872c331b4128a809495300617f080;p=dealii-svn.git Implemenation of new function Point::distance (const Point &p) git-svn-id: https://svn.dealii.org/trunk@3299 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/point.h b/deal.II/base/include/base/point.h index c094c31ca8..09caecfb2d 100644 --- a/deal.II/base/include/base/point.h +++ b/deal.II/base/include/base/point.h @@ -135,6 +135,12 @@ class Point : public Tensor<1,dim> * the square of the norm. */ double square () const; + + /** + * Returns the distance of @p{this} + * point to the point @p{p}. + */ + double distance (const Point &p) const; /** @@ -308,8 +314,6 @@ double Point::operator * (const Point &p) const }; - - template inline double Point::square () const @@ -321,6 +325,20 @@ double Point::square () const }; +template +inline +double Point::distance (const Point &p) const +{ + double sum=0; + for (unsigned int i=0; i inline