diff --git a/MathLib/MathTools.cpp b/MathLib/MathTools.cpp
index 236ceea081040fc86da26ade9ff26f66a420e7b4..51ff3bb9fde0e23cc2ecbde493ff2fc627dc7fb1 100644
--- a/MathLib/MathTools.cpp
+++ b/MathLib/MathTools.cpp
@@ -42,12 +42,6 @@ double calcProjPntToLineAndDists(const double p[3], const double a[3],
 	return sqrt (sqrDist (p, proj_pnt));
 }
 
-double sqrDist(const double* p0, const double* p1)
-{
-	const double v[3] = {p1[0] - p0[0], p1[1] - p0[1], p1[2] - p0[2]};
-	return scalarProduct<double,3>(v,v);
-}
-
 double getAngle (const double p0[3], const double p1[3], const double p2[3])
 {
 	const double v0[3] = {p0[0]-p1[0], p0[1]-p1[1], p0[2]-p1[2]};
diff --git a/MathLib/MathTools.h b/MathLib/MathTools.h
index 424745dacb02338edc30a26c9c67da1e4aeaad27..f037e46526a1a58fdf73a965a39175d91b46a325 100644
--- a/MathLib/MathTools.h
+++ b/MathLib/MathTools.h
@@ -122,7 +122,12 @@ bool operator==(TemplatePoint<T,DIM> const& a, TemplatePoint<T,DIM> const& b)
 }
 
 /** squared dist between double arrays p0 and p1 (size of arrays is 3) */
-double sqrDist(const double* p0, const double* p1);
+inline
+double sqrDist(const double* p0, const double* p1)
+{
+	const double v[3] = {p1[0] - p0[0], p1[1] - p0[1], p1[2] - p0[2]};
+	return scalarProduct<double,3>(v,v);
+}
 
 /** Distance between points p0 and p1 in the maximum norm. */
 template <typename T>