diff --git a/src/function/Matheval.cpp b/src/function/Matheval.cpp
index 4188d1d6c951da30f726277d5c128bb744b65e0d..7ff6ec4c979ccbea5b8f0bb68a03ad6486ee9e33 100644
--- a/src/function/Matheval.cpp
+++ b/src/function/Matheval.cpp
@@ -129,6 +129,39 @@ create. The equivalent of the AND operator is the product: `step(1.0-x)*step(x-0
 only equal to 1 when x is between 0.5 and 1.0. By combining negation and AND you can obtain an OR. That is,
 `1-step(1.0-x)*step(x-0.5)` is only equal to 1 when x is outside the 0.5-1.0 interval.
 
+MATHEVAL can be used in combination with \ref DISTANCE to implement variants of the
+DISTANCE keyword that were present in PLUMED 1.3 and that allowed to compute
+the distance of a point from a line defined by two other points, or the progression
+along that line.
+\verbatim
+# take center of atoms 1 to 10 as reference point 1
+p1: CENTER ATOMS=1-10
+# take center of atoms 11 to 20 as reference point 2
+p2: CENTER ATOMS=11-20
+# take center of atoms 21 to 30 as reference point 3
+p3: CENTER ATOMS=21-30
+
+# compute distances
+d12: DISTANCE ATOMS=p1,p2
+d13: DISTANCE ATOMS=p1,p3
+d23: DISTANCE ATOMS=p2,p3
+
+# compute progress variable of the projection of point p3
+# along the vector joining p1 and p2
+# notice that progress is measured from the middle point
+onaxis: MATHEVAL ARG=d13,d23,d12 FUNC=(0.5*(y^2-x^2)/z) PERIODIC=NO
+
+# compute between point p3 and the vector joining p1 and p2
+fromaxis: MATHEVAL ARG=d13,d23,d12,onaxis VAR=x,y,z,o FUNC=(0.5*(y^2+x^2)-o^2-0.25*z^2) PERIODIC=NO
+
+PRINT ARG=onaxis,fromaxis
+
+\endverbatim
+
+Notice that these equations have been used to combine \ref RMSD
+from different snapshots of a protein so as to define
+progression (S) and distance (Z) variables \cite perez2015atp.
+
 
 */
 //+ENDPLUMEDOC
diff --git a/user-doc/bibliography.bib b/user-doc/bibliography.bib
index 5b5911dc3c73655ae3d1231c5e1396fe69a5cb20..809dad3b542ddbcdce0020d7c66291837e01248c 100644
--- a/user-doc/bibliography.bib
+++ b/user-doc/bibliography.bib
@@ -2183,3 +2183,14 @@ number = {11},
 pages = {5062-5067},
 year = {2015}
 }
+
+@article{perez2015atp,
+  title={ATP dependent NS3 helicase interaction with RNA: insights from molecular simulations},
+  author={P{\'e}rez-Villa, Andrea and Darvas, Maria and Bussi, Giovanni},
+  journal={Nucleic Acids Research},
+  volume={43},
+  number={18},
+  pages={8725},
+  year={2015},
+  publisher={Oxford University Press}
+}
diff --git a/user-doc/tutorials/moving.txt b/user-doc/tutorials/moving.txt
index 30b7c44a8126b612434fcffd31e8efb6f0c1b6f0..6472ca5469fafa3a6f858d70cdc23cca234a1918 100644
--- a/user-doc/tutorials/moving.txt
+++ b/user-doc/tutorials/moving.txt
@@ -257,7 +257,7 @@ equivalent.  You should read the documentation for the PLUMED 2 Action.
 </TR>
 <TR>
   <TD> DISTANCE </TD>
-  <TD> \ref DISTANCE </TD>
+  <TD> \ref DISTANCE  - POINT_FROM_AXIS and PROJ_ON_AXIS can be reproduced with \ref DISTANCE and \ref MATHEVAL </TD>
 </TR>
 <TR>
   <TD> POSITION </TD>