From c32a9edcd0c67ab4f996a838edfa99ff17756aa1 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Wed, 21 Jan 2015 12:10:52 +0100
Subject: [PATCH] Rename all occurrences of MathPoint to Point3d.

---
 .../DataExplorer/DataView/GeoMapper.cpp       |  2 +-
 .../DataExplorer/DataView/GeoMapper.h         |  4 +-
 GeoLib/AnalyticalGeometry.cpp                 | 54 +++++++++----------
 GeoLib/AnalyticalGeometry.h                   | 48 ++++++++---------
 GeoLib/MinimalBoundingSphere.cpp              | 32 +++++------
 GeoLib/MinimalBoundingSphere.h                | 28 +++++-----
 GeoLib/Point.h                                | 10 ++--
 GeoLib/Polyline.cpp                           |  2 +-
 GeoLib/Polyline.h                             |  4 +-
 GeoLib/Raster.cpp                             |  6 +--
 GeoLib/Raster.h                               |  6 +--
 MeshLib/Elements/Element.h                    |  6 +--
 MeshLib/Elements/TemplateHex-impl.h           |  2 +-
 MeshLib/Elements/TemplateHex.h                |  4 +-
 MeshLib/Elements/TemplateLine-impl.h          |  2 +-
 MeshLib/Elements/TemplateLine.h               |  4 +-
 MeshLib/Elements/TemplatePrism-impl.h         |  2 +-
 MeshLib/Elements/TemplatePrism.h              |  4 +-
 MeshLib/Elements/TemplatePyramid-impl.h       |  2 +-
 MeshLib/Elements/TemplatePyramid.h            |  4 +-
 MeshLib/Elements/TemplateQuad-impl.h          |  2 +-
 MeshLib/Elements/TemplateQuad.h               |  4 +-
 MeshLib/Elements/TemplateTet-impl.h           |  2 +-
 MeshLib/Elements/TemplateTet.h                |  4 +-
 MeshLib/Elements/TemplateTri-impl.h           |  2 +-
 MeshLib/Elements/TemplateTri.h                |  4 +-
 MeshLib/MeshQuality/EdgeRatioMetric.cpp       | 34 ++++++------
 MeshLib/MeshQuality/EdgeRatioMetric.h         | 30 +++++------
 MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp |  2 +-
 MeshLib/Node.cpp                              |  6 +--
 MeshLib/Node.h                                |  4 +-
 NumLib/Function/ISpatialFunction.h            |  4 +-
 .../LinearInterpolationAlongPolyline.cpp      |  2 +-
 .../LinearInterpolationAlongPolyline.h        |  2 +-
 .../Function/LinearInterpolationOnSurface.cpp |  2 +-
 .../Function/LinearInterpolationOnSurface.h   |  2 +-
 NumLib/Function/TemplateSpatialFunction.h     |  2 +-
 Tests/GeoLib/TestBoundingSphere.cpp           | 34 ++++++------
 38 files changed, 184 insertions(+), 184 deletions(-)

diff --git a/Applications/DataExplorer/DataView/GeoMapper.cpp b/Applications/DataExplorer/DataView/GeoMapper.cpp
index 125d8375865..0cdabd1fc80 100644
--- a/Applications/DataExplorer/DataView/GeoMapper.cpp
+++ b/Applications/DataExplorer/DataView/GeoMapper.cpp
@@ -302,7 +302,7 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string &
 	this->mapOnMesh(mesh);
 }
 
-GeoLib::Point* GeoMapper::calcIntersection(MathLib::MathPoint const*const p1, MathLib::MathPoint const*const p2, GeoLib::Point const*const q1, GeoLib::Point const*const q2) const
+GeoLib::Point* GeoMapper::calcIntersection(MathLib::Point3d const*const p1, MathLib::Point3d const*const p2, GeoLib::Point const*const q1, GeoLib::Point const*const q2) const
 {
 	const double x1 = (*p1)[0], x2 = (*p2)[0], x3 = (*q1)[0], x4 = (*q2)[0];
 	const double y1 = (*p1)[1], y2 = (*p2)[1], y3 = (*q1)[1], y4 = (*q2)[1];
diff --git a/Applications/DataExplorer/DataView/GeoMapper.h b/Applications/DataExplorer/DataView/GeoMapper.h
index 8f90a4070c6..4167c7262a4 100644
--- a/Applications/DataExplorer/DataView/GeoMapper.h
+++ b/Applications/DataExplorer/DataView/GeoMapper.h
@@ -23,7 +23,7 @@
 #include "Grid.h"
 
 // MathLib
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace MeshLib {
 	class Mesh;
@@ -63,7 +63,7 @@ private:
 	float getDemElevation(GeoLib::Point const& pnt) const;
 
 	// Calculates the intersection of two lines embedded in the xy-plane
-	GeoLib::Point* calcIntersection(MathLib::MathPoint const*const p1, MathLib::MathPoint const*const p2, GeoLib::Point const*const q1, GeoLib::Point const*const q2) const;
+	GeoLib::Point* calcIntersection(MathLib::Point3d const*const p1, MathLib::Point3d const*const p2, GeoLib::Point const*const q1, GeoLib::Point const*const q2) const;
 
 	// Returns the position of a point within a line-segment
 	unsigned getPointPosInLine(GeoLib::Polyline const*const line, unsigned start, unsigned end, GeoLib::Point const*const point, double eps) const;
diff --git a/GeoLib/AnalyticalGeometry.cpp b/GeoLib/AnalyticalGeometry.cpp
index eda68f3dd37..23cb1be8430 100644
--- a/GeoLib/AnalyticalGeometry.cpp
+++ b/GeoLib/AnalyticalGeometry.cpp
@@ -199,10 +199,10 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
 	return false;
 }
 
-bool isPointInTriangle(MathLib::MathPoint const& p,
-                       MathLib::MathPoint const& a,
-                       MathLib::MathPoint const& b,
-                       MathLib::MathPoint const& c,
+bool isPointInTriangle(MathLib::Point3d const& p,
+                       MathLib::Point3d const& a,
+                       MathLib::Point3d const& b,
+                       MathLib::Point3d const& c,
                        double eps_pnt_out_of_plane,
                        double eps_pnt_out_of_tri,
                        GeoLib::TriangleTest algorithm)
@@ -219,10 +219,10 @@ bool isPointInTriangle(MathLib::MathPoint const& p,
 	return gaussPointInTriangle(p, a, b, c, eps_pnt_out_of_plane, eps_pnt_out_of_tri);
 }
 
-bool gaussPointInTriangle(MathLib::MathPoint const& q,
-                          MathLib::MathPoint const& a,
-                          MathLib::MathPoint const& b,
-                          MathLib::MathPoint const& c,
+bool gaussPointInTriangle(MathLib::Point3d const& q,
+                          MathLib::Point3d const& a,
+                          MathLib::Point3d const& b,
+                          MathLib::Point3d const& c,
                           double eps_pnt_out_of_plane,
                           double eps_pnt_out_of_tri)
 {
@@ -247,7 +247,7 @@ bool gaussPointInTriangle(MathLib::MathPoint const& q,
 
 	if (-lower <= y[0] && y[0] <= upper && -lower <= y[1] && y[1] <= upper && y[0] + y[1] <=
 	    upper) {
-		MathLib::MathPoint const q_projected(std::array<double,3>{{
+		MathLib::Point3d const q_projected(std::array<double,3>{{
 			a[0] + y[0] * v[0] + y[1] * w[0],
 			a[1] + y[0] * v[1] + y[1] * w[1],
 			a[2] + y[0] * v[2] + y[1] * w[2]
@@ -259,10 +259,10 @@ bool gaussPointInTriangle(MathLib::MathPoint const& q,
 	return false;
 }
 
-bool barycentricPointInTriangle(MathLib::MathPoint const& p,
-                                MathLib::MathPoint const& a,
-                                MathLib::MathPoint const& b,
-                                MathLib::MathPoint const& c,
+bool barycentricPointInTriangle(MathLib::Point3d const& p,
+                                MathLib::Point3d const& a,
+                                MathLib::Point3d const& b,
+                                MathLib::Point3d const& c,
                                 double eps_pnt_out_of_plane,
                                 double eps_pnt_out_of_tri)
 {
@@ -286,9 +286,9 @@ bool barycentricPointInTriangle(MathLib::MathPoint const& p,
 	return true;
 }
 
-bool isPointInTetrahedron(MathLib::MathPoint const& p,
-	MathLib::MathPoint const& a, MathLib::MathPoint const& b,
-	MathLib::MathPoint const& c, MathLib::MathPoint const& d, double eps)
+bool isPointInTetrahedron(MathLib::Point3d const& p,
+	MathLib::Point3d const& a, MathLib::Point3d const& b,
+	MathLib::Point3d const& c, MathLib::Point3d const& d, double eps)
 {
     double const d0 (orientation3d(d,a,b,c));
     // if tetrahedron is not coplanar
@@ -316,8 +316,8 @@ bool isPointInTetrahedron(MathLib::MathPoint const& p,
     return false;
 }
 
-double calcTriangleArea(MathLib::MathPoint const& a,
-    MathLib::MathPoint const& b, MathLib::MathPoint const& c)
+double calcTriangleArea(MathLib::Point3d const& a,
+    MathLib::Point3d const& b, MathLib::Point3d const& c)
 {
 	MathLib::Vector3 const u(a,c);
 	MathLib::Vector3 const v(a,b);
@@ -453,7 +453,7 @@ void rotatePointsToXZ(std::vector<GeoLib::Point*> &pnts)
 		(*(pnts[k]))[1] = 0.0; // should be -= d but there are numerical errors
 }
 
-GeoLib::Point* triangleLineIntersection(MathLib::MathPoint const& a, MathLib::MathPoint const& b, MathLib::MathPoint const& c, MathLib::MathPoint const& p, MathLib::MathPoint const& q)
+GeoLib::Point* triangleLineIntersection(MathLib::Point3d const& a, MathLib::Point3d const& b, MathLib::Point3d const& c, MathLib::Point3d const& p, MathLib::Point3d const& q)
 {
 	const MathLib::Vector3 pq(p, q);
 	const MathLib::Vector3 pa(p, a);
@@ -480,10 +480,10 @@ double scalarTriple(MathLib::Vector3 const& u, MathLib::Vector3 const& v, MathLi
 	return MathLib::scalarProduct(cross,w);
 }
 
-double orientation3d(MathLib::MathPoint const& p,
-                     MathLib::MathPoint const& a,
-                     MathLib::MathPoint const& b,
-                     MathLib::MathPoint const& c)
+double orientation3d(MathLib::Point3d const& p,
+                     MathLib::Point3d const& a,
+                     MathLib::Point3d const& b,
+                     MathLib::Point3d const& c)
 {
     MathLib::Vector3 const ap (a, p);
     MathLib::Vector3 const bp (b, p);
@@ -491,8 +491,8 @@ double orientation3d(MathLib::MathPoint const& p,
     return scalarTriple(bp,cp,ap);
 }
 
-bool dividedByPlane(const MathLib::MathPoint& a, const MathLib::MathPoint& b,
-	const MathLib::MathPoint& c, const MathLib::MathPoint& d)
+bool dividedByPlane(const MathLib::Point3d& a, const MathLib::Point3d& b,
+	const MathLib::Point3d& c, const MathLib::Point3d& d)
 {
 	for (unsigned x=0; x<3; ++x)
 	{
@@ -506,8 +506,8 @@ bool dividedByPlane(const MathLib::MathPoint& a, const MathLib::MathPoint& b,
 	return false;
 }
 
-bool isCoplanar(const MathLib::MathPoint& a, const MathLib::MathPoint& b,
-	const MathLib::MathPoint& c, const MathLib::MathPoint& d)
+bool isCoplanar(const MathLib::Point3d& a, const MathLib::Point3d& b,
+	const MathLib::Point3d& c, const MathLib::Point3d& d)
 {
 	const MathLib::Vector3 ab(a,b);
 	const MathLib::Vector3 ac(a,c);
diff --git a/GeoLib/AnalyticalGeometry.h b/GeoLib/AnalyticalGeometry.h
index 7561a45e5af..1aa44c198b6 100644
--- a/GeoLib/AnalyticalGeometry.h
+++ b/GeoLib/AnalyticalGeometry.h
@@ -108,8 +108,8 @@ void rotatePointsToXZ(std::vector<GeoLib::Point*> &pnts);
  * The formula is \f$A= \frac{1}{2} \cdot |u \times v|\f$, i.e. half of the area of the
  * parallelogram specified by the vectors\f$u=b-a\f$ and \f$v=c-a\f$.
  */
-double calcTriangleArea(MathLib::MathPoint const& a, MathLib::MathPoint const& b,
-    MathLib::MathPoint const& c);
+double calcTriangleArea(MathLib::Point3d const& a, MathLib::Point3d const& b,
+    MathLib::Point3d const& c);
 
 /**
  * Calculates the volume of a tetrahedron.
@@ -130,10 +130,10 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
  * @param algorithm defines the method to use
  * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
  */
-bool isPointInTriangle(MathLib::MathPoint const& p,
-                       MathLib::MathPoint const& a,
-                       MathLib::MathPoint const& b,
-                       MathLib::MathPoint const& c,
+bool isPointInTriangle(MathLib::Point3d const& p,
+                       MathLib::Point3d const& a,
+                       MathLib::Point3d const& b,
+                       MathLib::Point3d const& c,
                        double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
                        double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon(),
                        GeoLib::TriangleTest algorithm = GeoLib::GAUSS);
@@ -151,9 +151,9 @@ bool isPointInTriangle(MathLib::MathPoint const& p,
  * @param eps_pnt_out_of_tri eps allowing for p to be slightly off outside of abc
  * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
  */
-bool gaussPointInTriangle(MathLib::MathPoint const& p,
-    MathLib::MathPoint const& a, MathLib::MathPoint const& b,
-    MathLib::MathPoint const& c,
+bool gaussPointInTriangle(MathLib::Point3d const& p,
+    MathLib::Point3d const& a, MathLib::Point3d const& b,
+    MathLib::Point3d const& c,
     double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
     double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon());
 
@@ -170,9 +170,9 @@ bool gaussPointInTriangle(MathLib::MathPoint const& p,
  * @param eps_pnt_out_of_tri eps allowing for p to be slightly off outside of abc
  * @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
  */
-bool barycentricPointInTriangle(MathLib::MathPoint const& p,
-    MathLib::MathPoint const& a, MathLib::MathPoint const& b,
-    MathLib::MathPoint const& c,
+bool barycentricPointInTriangle(MathLib::Point3d const& p,
+    MathLib::Point3d const& a, MathLib::Point3d const& b,
+    MathLib::Point3d const& c,
     double eps_pnt_out_of_plane = std::numeric_limits<float>::epsilon(),
     double eps_pnt_out_of_tri = std::numeric_limits<float>::epsilon());
 
@@ -188,9 +188,9 @@ bool barycentricPointInTriangle(MathLib::MathPoint const& p,
  * @param eps Accounts for numerical inaccuracies by allowing a point to be slightly outside of the element and still be regarded as inside.
  * @return true if the test point p is not located outside of abcd (i.e. inside or on a plane/edge).
  */
-bool isPointInTetrahedron(MathLib::MathPoint const& p,
-    MathLib::MathPoint const& a, MathLib::MathPoint const& b,
-    MathLib::MathPoint const& c, MathLib::MathPoint const& d,
+bool isPointInTetrahedron(MathLib::Point3d const& p,
+    MathLib::Point3d const& a, MathLib::Point3d const& b,
+    MathLib::Point3d const& c, MathLib::Point3d const& d,
     double eps = std::numeric_limits<double>::epsilon());
 
 /**
@@ -232,7 +232,7 @@ bool lineSegmentIntersect (const GeoLib::Point& a, const GeoLib::Point& b,
  * This method requires ABC to be counterclockwise and PQ to point downward.
  * @return Intersection point or NULL if there is no intersection.
  */
-GeoLib::Point* triangleLineIntersection(MathLib::MathPoint const& a, MathLib::MathPoint const& b, MathLib::MathPoint const& c, MathLib::MathPoint const& p, MathLib::MathPoint const& q);
+GeoLib::Point* triangleLineIntersection(MathLib::Point3d const& a, MathLib::Point3d const& b, MathLib::Point3d const& c, MathLib::Point3d const& p, MathLib::Point3d const& q);
 
 /// Calculates the scalar triple (u x v) . w
 double scalarTriple(MathLib::Vector3 const& u, MathLib::Vector3 const& v, MathLib::Vector3 const& w);
@@ -246,10 +246,10 @@ double scalarTriple(MathLib::Vector3 const& u, MathLib::Vector3 const& v, MathLi
  * @return If the triangle abc is ordered counterclockwise when viewed from p, the method will return a negative value,
  * otherwise it will return a positive value. If p is coplanar with abc, the function will return 0.
  */
-double orientation3d(MathLib::MathPoint const& p,
-                     MathLib::MathPoint const& a,
-                     MathLib::MathPoint const& b,
-                     MathLib::MathPoint const& c);
+double orientation3d(MathLib::Point3d const& p,
+                     MathLib::Point3d const& a,
+                     MathLib::Point3d const& b,
+                     MathLib::Point3d const& c);
 
 /**
  * Checks if a and b can be placed on a plane such that c and d lie on different sides of said plane.
@@ -260,12 +260,12 @@ double orientation3d(MathLib::MathPoint const& p,
  * @param d second point to test
  * @return true, if such a plane can be found, false otherwise
  */
- bool dividedByPlane(const MathLib::MathPoint& a, const MathLib::MathPoint& b,
-     const MathLib::MathPoint& c, const MathLib::MathPoint& d);
+ bool dividedByPlane(const MathLib::Point3d& a, const MathLib::Point3d& b,
+     const MathLib::Point3d& c, const MathLib::Point3d& d);
 
  /// Checks if the four given points are located on a plane.
- bool isCoplanar(const MathLib::MathPoint& a, const MathLib::MathPoint& b,
-     const MathLib::MathPoint& c, const MathLib::MathPoint & d);
+ bool isCoplanar(const MathLib::Point3d& a, const MathLib::Point3d& b,
+     const MathLib::Point3d& c, const MathLib::Point3d & d);
 
 /**
  * Method first computes the intersection points of line segements of GeoLib::Polyline objects
diff --git a/GeoLib/MinimalBoundingSphere.cpp b/GeoLib/MinimalBoundingSphere.cpp
index b2fef2cda1b..a85dd08dfc1 100644
--- a/GeoLib/MinimalBoundingSphere.cpp
+++ b/GeoLib/MinimalBoundingSphere.cpp
@@ -27,13 +27,13 @@ MinimalBoundingSphere::MinimalBoundingSphere()
 }
 
 MinimalBoundingSphere::MinimalBoundingSphere(
-	MathLib::MathPoint const& p, double radius)
+	MathLib::Point3d const& p, double radius)
 : _radius(radius), _center(p)
 {
 }
 
 MinimalBoundingSphere::MinimalBoundingSphere(
-	MathLib::MathPoint const& p, MathLib::MathPoint const& q)
+	MathLib::Point3d const& p, MathLib::Point3d const& q)
 : _radius(std::numeric_limits<double>::epsilon()), _center(p)
 {
     MathLib::Vector3 const a(p, q);
@@ -46,8 +46,8 @@ MinimalBoundingSphere::MinimalBoundingSphere(
     }
 }
 
-MinimalBoundingSphere::MinimalBoundingSphere(MathLib::MathPoint const& p,
-	MathLib::MathPoint const& q, MathLib::MathPoint const& r)
+MinimalBoundingSphere::MinimalBoundingSphere(MathLib::Point3d const& p,
+	MathLib::Point3d const& q, MathLib::Point3d const& r)
 {
     MathLib::Vector3 const a(p,r);
     MathLib::Vector3 const b(p,q);
@@ -75,10 +75,10 @@ MinimalBoundingSphere::MinimalBoundingSphere(MathLib::MathPoint const& p,
     }
 }
 
-MinimalBoundingSphere::MinimalBoundingSphere(MathLib::MathPoint const& p,
-	MathLib::MathPoint const& q,
-	MathLib::MathPoint const& r,
-	MathLib::MathPoint const& s)
+MinimalBoundingSphere::MinimalBoundingSphere(MathLib::Point3d const& p,
+	MathLib::Point3d const& q,
+	MathLib::Point3d const& r,
+	MathLib::Point3d const& s)
 {
     MathLib::Vector3 const a(p, q);
     MathLib::Vector3 const b(p, r);
@@ -122,10 +122,10 @@ MinimalBoundingSphere::MinimalBoundingSphere(MathLib::MathPoint const& p,
 }
 
 MinimalBoundingSphere::MinimalBoundingSphere(
-	std::vector<MathLib::MathPoint*> const& points)
+	std::vector<MathLib::Point3d*> const& points)
 : _radius(-1), _center(0,0,0)
 {
-	std::vector<MathLib::MathPoint*> sphere_points(points);
+	std::vector<MathLib::Point3d*> sphere_points(points);
 	MinimalBoundingSphere const bounding_sphere = recurseCalculation(sphere_points, 0, sphere_points.size(), 0);
 	_center = bounding_sphere.getCenter();
 	_radius = bounding_sphere.getRadius();
@@ -133,7 +133,7 @@ MinimalBoundingSphere::MinimalBoundingSphere(
 
 MinimalBoundingSphere
 MinimalBoundingSphere::recurseCalculation(
-	std::vector<MathLib::MathPoint*> sphere_points,
+	std::vector<MathLib::Point3d*> sphere_points,
 	std::size_t start_idx,
 	std::size_t length,
 	std::size_t n_boundary_points)
@@ -165,7 +165,7 @@ MinimalBoundingSphere::recurseCalculation(
         {
             if (i>start_idx)
             {
-                MathLib::MathPoint* tmp = sphere_points[start_idx+i];
+                MathLib::Point3d* tmp = sphere_points[start_idx+i];
                 std::copy(sphere_points.begin() + start_idx,
                     sphere_points.begin() + (start_idx + i),
                     sphere_points.begin() + (start_idx + 1));
@@ -177,14 +177,14 @@ MinimalBoundingSphere::recurseCalculation(
     return sphere;
 }
 
-double MinimalBoundingSphere::pointDistanceSquared(MathLib::MathPoint const& pnt) const
+double MinimalBoundingSphere::pointDistanceSquared(MathLib::Point3d const& pnt) const
 {
     return MathLib::sqrDist(_center.getCoords(), pnt.getCoords())-(_radius*_radius);
 }
 
-std::vector<MathLib::MathPoint*>* MinimalBoundingSphere::getRandomSpherePoints(std::size_t n_points) const
+std::vector<MathLib::Point3d*>* MinimalBoundingSphere::getRandomSpherePoints(std::size_t n_points) const
 {
-    std::vector<MathLib::MathPoint*> *pnts = new std::vector<MathLib::MathPoint*>;
+    std::vector<MathLib::Point3d*> *pnts = new std::vector<MathLib::Point3d*>;
     pnts->reserve(n_points);
     srand ( static_cast<unsigned>(time(NULL)) );
 
@@ -198,7 +198,7 @@ std::vector<MathLib::MathPoint*>* MinimalBoundingSphere::getRandomSpherePoints(s
             sum+=(vec[i]*vec[i]);
         }
         double const fac (_radius/sqrt(sum));
-        pnts->push_back(new MathLib::MathPoint(_center+fac * vec));
+        pnts->push_back(new MathLib::Point3d(_center+fac * vec));
     }
     return pnts;
 }
diff --git a/GeoLib/MinimalBoundingSphere.h b/GeoLib/MinimalBoundingSphere.h
index 6b934d1682e..3d86fed4af2 100644
--- a/GeoLib/MinimalBoundingSphere.h
+++ b/GeoLib/MinimalBoundingSphere.h
@@ -19,7 +19,7 @@
 #include <vector>
 
 #include "MathLib/Vector3.h"
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace GeoLib
 {
@@ -33,32 +33,32 @@ public:
     /// Copy constructor
     MinimalBoundingSphere(MinimalBoundingSphere const&) = default;
     /// Point-Sphere
-    MinimalBoundingSphere(MathLib::MathPoint const& p, double radius = std::numeric_limits<double>::epsilon());
+    MinimalBoundingSphere(MathLib::Point3d const& p, double radius = std::numeric_limits<double>::epsilon());
     /// Bounding sphere using two points
-    MinimalBoundingSphere(MathLib::MathPoint const& p, MathLib::MathPoint const& q);
+    MinimalBoundingSphere(MathLib::Point3d const& p, MathLib::Point3d const& q);
     /// Bounding sphere using three points
-    MinimalBoundingSphere(MathLib::MathPoint const& p,
-        MathLib::MathPoint const& q, MathLib::MathPoint const& r);
+    MinimalBoundingSphere(MathLib::Point3d const& p,
+        MathLib::Point3d const& q, MathLib::Point3d const& r);
     /// Bounding sphere using four points
-    MinimalBoundingSphere(MathLib::MathPoint const& p,
-        MathLib::MathPoint const& q,
-        MathLib::MathPoint const& r,
-        MathLib::MathPoint const& s);
+    MinimalBoundingSphere(MathLib::Point3d const& p,
+        MathLib::Point3d const& q,
+        MathLib::Point3d const& r,
+        MathLib::Point3d const& s);
     /// Bounding sphere of n points
-    MinimalBoundingSphere(std::vector<MathLib::MathPoint*> const& points);
+    MinimalBoundingSphere(std::vector<MathLib::Point3d*> const& points);
     ~MinimalBoundingSphere() {}
 
     /// Returns the center point of the sphere
-    MathLib::MathPoint getCenter() const { return MathLib::MathPoint(_center.getCoords()); }
+    MathLib::Point3d getCenter() const { return MathLib::Point3d(_center.getCoords()); }
 
     /// Returns the radius of the sphere
     double getRadius() const {return _radius; }
 
     /// Returns the squared euclidean distance of a point from the sphere (for points within the sphere distance is negative)
-    double pointDistanceSquared(MathLib::MathPoint const& pnt) const;
+    double pointDistanceSquared(MathLib::Point3d const& pnt) const;
 
     /// Creates n_points random points located on the surface of the bounding sphere (useful for visualisation)
-    std::vector<MathLib::MathPoint*>*
+    std::vector<MathLib::Point3d*>*
     getRandomSpherePoints(std::size_t n_points) const;
 
 private:
@@ -79,7 +79,7 @@ private:
      * Code based on "Smallest Enclosing Spheres" implementation by Nicolas Capens on flipcode's Developer Toolbox (www.flipcode.com)
      */
     static MinimalBoundingSphere recurseCalculation(
-        std::vector<MathLib::MathPoint*> sphere_points,
+        std::vector<MathLib::Point3d*> sphere_points,
         std::size_t start_idx,
         std::size_t length,
         std::size_t n_boundary_points);
diff --git a/GeoLib/Point.h b/GeoLib/Point.h
index e2f5afab72c..b795f02c2c7 100644
--- a/GeoLib/Point.h
+++ b/GeoLib/Point.h
@@ -19,7 +19,7 @@
 #include "GeoObject.h"
 
 // MathLib
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace GeoLib
 {
@@ -27,11 +27,11 @@ namespace GeoLib
  * \ingroup GeoLib
  */
 
-class Point : public MathLib::MathPoint, public GeoLib::GeoObject
+class Point : public MathLib::Point3d, public GeoLib::GeoObject
 {
 public:
 	Point(double x1, double x2, double x3) :
-		MathLib::MathPoint(), GeoLib::GeoObject()
+		MathLib::Point3d(), GeoLib::GeoObject()
 	{
 		this->_x[0] = x1;
 		this->_x[1] = x2;
@@ -39,11 +39,11 @@ public:
 	}
 
 	Point() :
-		MathLib::MathPoint(), GeoLib::GeoObject()
+		MathLib::Point3d(), GeoLib::GeoObject()
 	{}
 
 	Point (double const* x) :
-		MathLib::MathPoint(x), GeoLib::GeoObject()
+		MathLib::Point3d(x), GeoLib::GeoObject()
 	{}
 
 	/// return a geometry type
diff --git a/GeoLib/Polyline.cpp b/GeoLib/Polyline.cpp
index ebaa167dee8..b3a8af26b9a 100644
--- a/GeoLib/Polyline.cpp
+++ b/GeoLib/Polyline.cpp
@@ -377,7 +377,7 @@ void Polyline::updatePointIDs(const std::vector<std::size_t> &pnt_ids)
 	}
 }
 
-double Polyline::getDistanceAlongPolyline(const MathLib::MathPoint& pnt,
+double Polyline::getDistanceAlongPolyline(const MathLib::Point3d& pnt,
 	const double epsilon_radius) const
 {
 	double dist, lambda;
diff --git a/GeoLib/Polyline.h b/GeoLib/Polyline.h
index 7242e8ff0e7..1f5e5bf8d52 100644
--- a/GeoLib/Polyline.h
+++ b/GeoLib/Polyline.h
@@ -23,7 +23,7 @@
 #include "Point.h"
 
 // MathLib
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace GeoLib
 {
@@ -154,7 +154,7 @@ public:
 	 * @return the distance along the polyline between the given point and the beginning of the polyline.
 	 * If the given point is not on the polyine, negative value is returned.
 	 */
-	double getDistanceAlongPolyline(const MathLib::MathPoint& pnt,
+	double getDistanceAlongPolyline(const MathLib::Point3d& pnt,
 		const double epsilon_radius) const;
 
 	friend bool operator==(Polyline const& lhs, Polyline const& rhs);
diff --git a/GeoLib/Raster.cpp b/GeoLib/Raster.cpp
index fc4270de567..5d7fdac112d 100644
--- a/GeoLib/Raster.cpp
+++ b/GeoLib/Raster.cpp
@@ -101,7 +101,7 @@ Raster* Raster::getRasterFromSurface(Surface const& sfc, double cell_size, doubl
 	return new Raster(n_cols, n_rows, ll[0], ll[1], cell_size, z_vals, z_vals+n_cols*n_rows ,-9999);
 }
 
-double Raster::getValueAtPoint(const MathLib::MathPoint &pnt) const
+double Raster::getValueAtPoint(const MathLib::Point3d &pnt) const
 {
 	if (pnt[0]>=_ll_pnt[0] && pnt[0]<(_ll_pnt[0]+(_cell_size*_n_cols)) && 
 		pnt[1]>=_ll_pnt[1] && pnt[1]<(_ll_pnt[1]+(_cell_size*_n_rows)))
@@ -119,7 +119,7 @@ double Raster::getValueAtPoint(const MathLib::MathPoint &pnt) const
 	return _no_data_val;
 }
 
-double Raster::interpolateValueAtPoint(MathLib::MathPoint const& pnt) const
+double Raster::interpolateValueAtPoint(MathLib::Point3d const& pnt) const
 {
     // position in raster
     double const xPos ((pnt[0] - _ll_pnt[0]) / _cell_size);
@@ -167,7 +167,7 @@ double Raster::interpolateValueAtPoint(MathLib::MathPoint const& pnt) const
     return MathLib::scalarProduct<double,4>(weight.data(), pix_val.data());
 }
 
-bool Raster::isPntOnRaster(MathLib::MathPoint const& pnt) const
+bool Raster::isPntOnRaster(MathLib::Point3d const& pnt) const
 {
     if ((pnt[0]<_ll_pnt[0]) || (pnt[0]>_ll_pnt[0]+(_n_cols*_cell_size)) || 
         (pnt[1]<_ll_pnt[1]) || (pnt[1]>_ll_pnt[1]+(_n_rows*_cell_size)))
diff --git a/GeoLib/Raster.h b/GeoLib/Raster.h
index 1199f7b81f0..4ccb001bf7d 100644
--- a/GeoLib/Raster.h
+++ b/GeoLib/Raster.h
@@ -99,13 +99,13 @@ public:
 	/**
 	 * Returns the raster value at the position of the given point.
 	 */
-	double getValueAtPoint(const MathLib::MathPoint &pnt) const;
+	double getValueAtPoint(const MathLib::Point3d &pnt) const;
 
 	/// Interpolates the elevation of the given point based on the 8-neighbourhood of the raster cell it is located on
-	double interpolateValueAtPoint(const MathLib::MathPoint &pnt) const;
+	double interpolateValueAtPoint(const MathLib::Point3d &pnt) const;
     
 	/// Checks if the given point is located within the (x,y)-extension of the raster.
-	bool isPntOnRaster(MathLib::MathPoint const& node) const;
+	bool isPntOnRaster(MathLib::Point3d const& node) const;
 
 	~Raster();
 
diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h
index a39e56b781e..5b856a6e61e 100644
--- a/MeshLib/Elements/Element.h
+++ b/MeshLib/Elements/Element.h
@@ -19,7 +19,7 @@
 #include <limits>
 #include <boost/optional.hpp>
 
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 #include "MeshLib/MeshEnums.h"
 #include "MeshLib/Mesh.h"
@@ -163,11 +163,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	virtual bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const = 0;
+	virtual bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const = 0;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplateHex-impl.h b/MeshLib/Elements/TemplateHex-impl.h
index 5c3713d7d95..cb1be254d82 100644
--- a/MeshLib/Elements/TemplateHex-impl.h
+++ b/MeshLib/Elements/TemplateHex-impl.h
@@ -141,7 +141,7 @@ bool TemplateHex<NNODES,CELLHEXTYPE>::isEdge(unsigned idx1, unsigned idx2) const
 }
 
 template <unsigned NNODES, CellType CELLHEXTYPE>
-bool TemplateHex<NNODES,CELLHEXTYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplateHex<NNODES,CELLHEXTYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
     return (GeoLib::isPointInTetrahedron(pnt, *_nodes[4], *_nodes[7], *_nodes[5], *_nodes[0], eps) ||
             GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[3], *_nodes[1], *_nodes[0], eps) ||
diff --git a/MeshLib/Elements/TemplateHex.h b/MeshLib/Elements/TemplateHex.h
index 5aa4a0dc61f..e781bea7154 100644
--- a/MeshLib/Elements/TemplateHex.h
+++ b/MeshLib/Elements/TemplateHex.h
@@ -112,11 +112,11 @@ public:
 
     /**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-    bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+    bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplateLine-impl.h b/MeshLib/Elements/TemplateLine-impl.h
index 56c36c2f5e8..01ae92f2848 100644
--- a/MeshLib/Elements/TemplateLine-impl.h
+++ b/MeshLib/Elements/TemplateLine-impl.h
@@ -56,7 +56,7 @@ TemplateLine<NNODES,CELLLINETYPE>::~TemplateLine()
 {}
 
 template <unsigned NNODES, CellType CELLLINETYPE>
-bool TemplateLine<NNODES,CELLLINETYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplateLine<NNODES,CELLLINETYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
     double tmp;
     double tmp_dst(0);
diff --git a/MeshLib/Elements/TemplateLine.h b/MeshLib/Elements/TemplateLine.h
index 8f8d7130122..514e8b3c99a 100644
--- a/MeshLib/Elements/TemplateLine.h
+++ b/MeshLib/Elements/TemplateLine.h
@@ -123,11 +123,11 @@ public:
 
 	/**
 	 * Checks if a point is located on the line
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is located on the line, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 		* Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplatePrism-impl.h b/MeshLib/Elements/TemplatePrism-impl.h
index 24b8c01a231..1393be91522 100644
--- a/MeshLib/Elements/TemplatePrism-impl.h
+++ b/MeshLib/Elements/TemplatePrism-impl.h
@@ -148,7 +148,7 @@ bool TemplatePrism<NNODES,CELLPRISMTYPE>::isEdge(unsigned idx1, unsigned idx2) c
 }
 
 template <unsigned NNODES, CellType CELLPRISMTYPE>
-bool TemplatePrism<NNODES,CELLPRISMTYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplatePrism<NNODES,CELLPRISMTYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
     return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps) ||
             GeoLib::isPointInTetrahedron(pnt, *_nodes[1], *_nodes[4], *_nodes[2], *_nodes[3], eps) ||
diff --git a/MeshLib/Elements/TemplatePrism.h b/MeshLib/Elements/TemplatePrism.h
index 064099b39ad..5f7aa36066c 100644
--- a/MeshLib/Elements/TemplatePrism.h
+++ b/MeshLib/Elements/TemplatePrism.h
@@ -110,11 +110,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplatePyramid-impl.h b/MeshLib/Elements/TemplatePyramid-impl.h
index 704b03aa216..9328c2109ac 100644
--- a/MeshLib/Elements/TemplatePyramid-impl.h
+++ b/MeshLib/Elements/TemplatePyramid-impl.h
@@ -150,7 +150,7 @@ bool TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::isEdge(unsigned idx1, unsigned idx
 }
 
 template <unsigned NNODES, CellType CELLPYRAMIDTYPE>
-bool TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
     return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[4], eps) ||
             GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[2], *_nodes[3], *_nodes[4], eps));
diff --git a/MeshLib/Elements/TemplatePyramid.h b/MeshLib/Elements/TemplatePyramid.h
index a50851c05f1..8c874e7daae 100644
--- a/MeshLib/Elements/TemplatePyramid.h
+++ b/MeshLib/Elements/TemplatePyramid.h
@@ -108,11 +108,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplateQuad-impl.h b/MeshLib/Elements/TemplateQuad-impl.h
index f993842b0d0..864ab3f5385 100644
--- a/MeshLib/Elements/TemplateQuad-impl.h
+++ b/MeshLib/Elements/TemplateQuad-impl.h
@@ -104,7 +104,7 @@ bool TemplateQuad<NNODES,CELLQUADTYPE>::isEdge(unsigned idx1, unsigned idx2) con
 }
 
 template <unsigned NNODES, CellType CELLQUADTYPE>
-bool TemplateQuad<NNODES,CELLQUADTYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplateQuad<NNODES,CELLQUADTYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
 	return (GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps) ||
 	        GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[2], *_nodes[3], eps));
diff --git a/MeshLib/Elements/TemplateQuad.h b/MeshLib/Elements/TemplateQuad.h
index e5058a8b299..573e5474ece 100644
--- a/MeshLib/Elements/TemplateQuad.h
+++ b/MeshLib/Elements/TemplateQuad.h
@@ -97,11 +97,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplateTet-impl.h b/MeshLib/Elements/TemplateTet-impl.h
index 5ff0d13e772..5ddb6c5176e 100644
--- a/MeshLib/Elements/TemplateTet-impl.h
+++ b/MeshLib/Elements/TemplateTet-impl.h
@@ -128,7 +128,7 @@ bool TemplateTet<NNODES,CELLTETTYPE>::isEdge(unsigned idx1, unsigned idx2) const
 }
 
 template <unsigned NNODES, CellType CELLTETTYPE>
-bool TemplateTet<NNODES,CELLTETTYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplateTet<NNODES,CELLTETTYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
     return GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps);
 }
diff --git a/MeshLib/Elements/TemplateTet.h b/MeshLib/Elements/TemplateTet.h
index aad0a51b771..dce10086ad0 100644
--- a/MeshLib/Elements/TemplateTet.h
+++ b/MeshLib/Elements/TemplateTet.h
@@ -107,11 +107,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid.
diff --git a/MeshLib/Elements/TemplateTri-impl.h b/MeshLib/Elements/TemplateTri-impl.h
index 6951024d8b6..1e204207cd1 100644
--- a/MeshLib/Elements/TemplateTri-impl.h
+++ b/MeshLib/Elements/TemplateTri-impl.h
@@ -85,7 +85,7 @@ bool TemplateTri<NNODES,CELLTRITYPE>::isEdge(unsigned idx1, unsigned idx2) const
 }
 
 template <unsigned NNODES, CellType CELLTRITYPE>
-bool TemplateTri<NNODES,CELLTRITYPE>::isPntInElement(MathLib::MathPoint const& pnt, double eps) const
+bool TemplateTri<NNODES,CELLTRITYPE>::isPntInElement(MathLib::Point3d const& pnt, double eps) const
 {
 	return GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps);
 }
diff --git a/MeshLib/Elements/TemplateTri.h b/MeshLib/Elements/TemplateTri.h
index c4b887d0af8..f5e20108809 100644
--- a/MeshLib/Elements/TemplateTri.h
+++ b/MeshLib/Elements/TemplateTri.h
@@ -103,11 +103,11 @@ public:
 
 	/**
 	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::MathPoint object
+	 * @param pnt a 3D MathLib::Point3d object
 	 * @param eps tolerance for numerical algorithm used or computing the property
 	 * @return true if the point is not outside the element, false otherwise
 	 */
-	bool isPntInElement(MathLib::MathPoint const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
+	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const;
 
 	/**
 	 * Tests if the element is geometrically valid
diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.cpp b/MeshLib/MeshQuality/EdgeRatioMetric.cpp
index 8c5bcd17edd..278dfaf83af 100644
--- a/MeshLib/MeshQuality/EdgeRatioMetric.cpp
+++ b/MeshLib/MeshQuality/EdgeRatioMetric.cpp
@@ -50,21 +50,21 @@ void EdgeRatioMetric::calculateQuality()
 			break;
 		}
 		case MeshElemType::PRISM: {
-			std::vector<const MathLib::MathPoint*> pnts;
+			std::vector<const MathLib::Point3d*> pnts;
 			for (size_t j(0); j < 6; j++)
 				pnts.push_back(elem.getNode(j));
 			_element_quality_metric[k] = checkPrism(pnts);
 			break;
 		}
 		case MeshElemType::PYRAMID: {
-			std::vector<const MathLib::MathPoint*> pnts;
+			std::vector<const MathLib::Point3d*> pnts;
 			for (size_t j(0); j < 5; j++)
 				pnts.push_back(elem.getNode(j));
 			_element_quality_metric[k] = checkPyramid(pnts);
 			break;
 		}
 		case MeshElemType::HEXAHEDRON: {
-			std::vector<const MathLib::MathPoint*> pnts;
+			std::vector<const MathLib::Point3d*> pnts;
 			for (size_t j(0); j < 8; j++)
 				pnts.push_back(elem.getNode(j));
 			_element_quality_metric[k] = checkHexahedron(pnts);
@@ -77,9 +77,9 @@ void EdgeRatioMetric::calculateQuality()
 	}
 }
 
-double EdgeRatioMetric::checkTriangle (MathLib::MathPoint const& a,
-                                       MathLib::MathPoint const& b,
-                                       MathLib::MathPoint const& c) const
+double EdgeRatioMetric::checkTriangle (MathLib::Point3d const& a,
+                                       MathLib::Point3d const& b,
+                                       MathLib::Point3d const& c) const
 {
 	double len0 (sqrt(MathLib::sqrDist (b,a)));
 	double len1 (sqrt(MathLib::sqrDist (b,c)));
@@ -111,10 +111,10 @@ double EdgeRatioMetric::checkTriangle (MathLib::MathPoint const& a,
 	}
 }
 
-double EdgeRatioMetric::checkQuad (MathLib::MathPoint const& a,
-                                   MathLib::MathPoint const& b,
-                                   MathLib::MathPoint const& c,
-                                   MathLib::MathPoint const& d) const
+double EdgeRatioMetric::checkQuad (MathLib::Point3d const& a,
+                                   MathLib::Point3d const& b,
+                                   MathLib::Point3d const& c,
+                                   MathLib::Point3d const& d) const
 {
 	double sqr_lengths[4] = {MathLib::sqrDist (b,a),
 		                 MathLib::sqrDist (c,b),
@@ -130,10 +130,10 @@ double EdgeRatioMetric::checkQuad (MathLib::MathPoint const& a,
 	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[3]);
 }
 
-double EdgeRatioMetric::checkTetrahedron (MathLib::MathPoint const& a,
-                                          MathLib::MathPoint const& b,
-                                          MathLib::MathPoint const& c,
-                                          MathLib::MathPoint const& d) const
+double EdgeRatioMetric::checkTetrahedron (MathLib::Point3d const& a,
+                                          MathLib::Point3d const& b,
+                                          MathLib::Point3d const& c,
+                                          MathLib::Point3d const& d) const
 {
 	double sqr_lengths[6] = {MathLib::sqrDist (b,a), MathLib::sqrDist (c,b),
 		                 MathLib::sqrDist (c,a), MathLib::sqrDist (a,d),
@@ -148,7 +148,7 @@ double EdgeRatioMetric::checkTetrahedron (MathLib::MathPoint const& a,
 	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[5]);
 }
 
-double EdgeRatioMetric::checkPrism (std::vector<const MathLib::MathPoint*> const& pnts) const
+double EdgeRatioMetric::checkPrism (std::vector<const MathLib::Point3d*> const& pnts) const
 {
 	double sqr_lengths[9] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
 		                 MathLib::sqrDist (*pnts[1],*pnts[2]),
@@ -169,7 +169,7 @@ double EdgeRatioMetric::checkPrism (std::vector<const MathLib::MathPoint*> const
 	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[8]);
 }
 
-double EdgeRatioMetric::checkPyramid (std::vector<const MathLib::MathPoint*> const &pnts) const
+double EdgeRatioMetric::checkPyramid (std::vector<const MathLib::Point3d*> const &pnts) const
 {
 	double sqr_lengths[8] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
 		                 MathLib::sqrDist (*pnts[1],*pnts[2]),
@@ -189,7 +189,7 @@ double EdgeRatioMetric::checkPyramid (std::vector<const MathLib::MathPoint*> con
 	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[7]);
 }
 
-double EdgeRatioMetric::checkHexahedron (std::vector<const MathLib::MathPoint*> const & pnts) const
+double EdgeRatioMetric::checkHexahedron (std::vector<const MathLib::Point3d*> const & pnts) const
 {
 	double sqr_lengths[12] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
 		                  MathLib::sqrDist (*pnts[1],*pnts[2]),
diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.h b/MeshLib/MeshQuality/EdgeRatioMetric.h
index eb3547a090f..20a1ee57441 100644
--- a/MeshLib/MeshQuality/EdgeRatioMetric.h
+++ b/MeshLib/MeshQuality/EdgeRatioMetric.h
@@ -16,7 +16,7 @@
 #define EDGERATIOMETRIC_H_
 
 #include "ElementQualityMetric.h"
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace MeshLib
 {
@@ -33,20 +33,20 @@ public:
     virtual void calculateQuality ();
 
 private:
-    double checkTriangle (MathLib::MathPoint const& a,
-                          MathLib::MathPoint const& b,
-                          MathLib::MathPoint const& c) const;
-    double checkQuad (MathLib::MathPoint const& a,
-                      MathLib::MathPoint const& b,
-                      MathLib::MathPoint const& c,
-                      MathLib::MathPoint const& d) const;
-    double checkTetrahedron (MathLib::MathPoint const& a,
-                             MathLib::MathPoint const& b,
-                             MathLib::MathPoint const& c,
-                             MathLib::MathPoint const& d) const;
-    double checkPrism (std::vector<const MathLib::MathPoint*> const& pnts) const;
-    double checkPyramid (std::vector<const MathLib::MathPoint*> const& pnts) const;
-    double checkHexahedron (std::vector<const MathLib::MathPoint*> const& pnts) const;
+    double checkTriangle (MathLib::Point3d const& a,
+                          MathLib::Point3d const& b,
+                          MathLib::Point3d const& c) const;
+    double checkQuad (MathLib::Point3d const& a,
+                      MathLib::Point3d const& b,
+                      MathLib::Point3d const& c,
+                      MathLib::Point3d const& d) const;
+    double checkTetrahedron (MathLib::Point3d const& a,
+                             MathLib::Point3d const& b,
+                             MathLib::Point3d const& c,
+                             MathLib::Point3d const& d) const;
+    double checkPrism (std::vector<const MathLib::Point3d*> const& pnts) const;
+    double checkPyramid (std::vector<const MathLib::Point3d*> const& pnts) const;
+    double checkHexahedron (std::vector<const MathLib::Point3d*> const& pnts) const;
 };
 }
 
diff --git a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp
index 22fa2bc5faf..0f047e0a596 100644
--- a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp
+++ b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp
@@ -32,7 +32,7 @@ void RadiusEdgeRatioMetric::calculateQuality ()
     {
         Element const& elem (*elements[k]);
         std::size_t const n_nodes (elem.getNBaseNodes());
-        std::vector<MathLib::MathPoint*> pnts(n_nodes);
+        std::vector<MathLib::Point3d*> pnts(n_nodes);
         std::copy_n(elem.getNodes(), n_nodes, pnts.begin());
         GeoLib::MinimalBoundingSphere const s(pnts);
         double min, max;
diff --git a/MeshLib/Node.cpp b/MeshLib/Node.cpp
index 8c4d76327db..cc9ccb5a844 100644
--- a/MeshLib/Node.cpp
+++ b/MeshLib/Node.cpp
@@ -18,17 +18,17 @@
 namespace MeshLib {
 
 Node::Node(const double coords[3], std::size_t id)
-	: MathLib::MathPoint(coords), _id(id)
+	: MathLib::Point3d(coords), _id(id)
 {
 }
 
 Node::Node(double x, double y, double z, std::size_t id)
-	: MathLib::MathPoint(std::array<double,3>({{x, y, z}})), _id(id)
+	: MathLib::Point3d(std::array<double,3>({{x, y, z}})), _id(id)
 {
 }
 
 Node::Node(const Node &node)
-	: MathLib::MathPoint(node.getCoords()), _id(node.getID())
+	: MathLib::Point3d(node.getCoords()), _id(node.getID())
 {
 }
 
diff --git a/MeshLib/Node.h b/MeshLib/Node.h
index 8c74e8ef91e..608e2badf96 100644
--- a/MeshLib/Node.h
+++ b/MeshLib/Node.h
@@ -20,7 +20,7 @@
 #include <set>
 #include <vector>
 
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 #include "MeshEditing/removeMeshNodes.h"
 #include "MeshGenerators/MeshLayerMapper.h"
@@ -35,7 +35,7 @@ class Element;
 /**
  * A mesh node with coordinates in 3D space.
  */
-class Node : public MathLib::MathPoint
+class Node : public MathLib::Point3d
 {
 	/* friend functions: */
 	friend bool MeshLayerMapper::layerMapping(MeshLib::Mesh &mesh, const GeoLib::Raster &raster, double noDataReplacementValue);
diff --git a/NumLib/Function/ISpatialFunction.h b/NumLib/Function/ISpatialFunction.h
index 16b9a79301d..dbd97e864d7 100644
--- a/NumLib/Function/ISpatialFunction.h
+++ b/NumLib/Function/ISpatialFunction.h
@@ -16,7 +16,7 @@
 
 #include <vector>
 
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 namespace NumLib
 {
@@ -34,7 +34,7 @@ public:
 	 * \param pnt  a point object
 	 * \return evaluated value
 	 */
-	virtual double operator()(const MathLib::MathPoint& pnt) const = 0;
+	virtual double operator()(const MathLib::Point3d& pnt) const = 0;
 };
 
 } // NumLib
diff --git a/NumLib/Function/LinearInterpolationAlongPolyline.cpp b/NumLib/Function/LinearInterpolationAlongPolyline.cpp
index f3f442b81f8..4549a5e3a21 100644
--- a/NumLib/Function/LinearInterpolationAlongPolyline.cpp
+++ b/NumLib/Function/LinearInterpolationAlongPolyline.cpp
@@ -57,7 +57,7 @@ MathLib::PiecewiseLinearInterpolation LinearInterpolationAlongPolyline::createIn
 	return MathLib::PiecewiseLinearInterpolation(vec_known_dist, vec_known_values);
 }
 
-double LinearInterpolationAlongPolyline::operator()(const MathLib::MathPoint& pnt) const
+double LinearInterpolationAlongPolyline::operator()(const MathLib::Point3d& pnt) const
 {
 	const double dist = _ply.getDistanceAlongPolyline(pnt, _search_length);
 	return dist>=0 ? _interpolation.getValue(dist) : _default_value;
diff --git a/NumLib/Function/LinearInterpolationAlongPolyline.h b/NumLib/Function/LinearInterpolationAlongPolyline.h
index acaa268b2bd..78473eef730 100644
--- a/NumLib/Function/LinearInterpolationAlongPolyline.h
+++ b/NumLib/Function/LinearInterpolationAlongPolyline.h
@@ -62,7 +62,7 @@ public:
 	 * @return interpolated value. A default value is returned if the given point
 	 * is not located on a polyline
 	 */
-	double operator()(const MathLib::MathPoint& pnt) const;
+	double operator()(const MathLib::Point3d& pnt) const;
 
 private:
 	/// construct an interpolation algorithm
diff --git a/NumLib/Function/LinearInterpolationOnSurface.cpp b/NumLib/Function/LinearInterpolationOnSurface.cpp
index 760ea20d0a7..f5fd90ee7ca 100644
--- a/NumLib/Function/LinearInterpolationOnSurface.cpp
+++ b/NumLib/Function/LinearInterpolationOnSurface.cpp
@@ -39,7 +39,7 @@ LinearInterpolationOnSurface::LinearInterpolationOnSurface(
 	assert(vec_interpolate_point_ids.size()==vec_interpolate_point_values.size());
 }
 
-double LinearInterpolationOnSurface::operator()(const MathLib::MathPoint& pnt) const
+double LinearInterpolationOnSurface::operator()(const MathLib::Point3d& pnt) const
 {
 	const double* coords = pnt.getCoords();
 	if (!_sfc.isPntInBoundingVolume(coords))
diff --git a/NumLib/Function/LinearInterpolationOnSurface.h b/NumLib/Function/LinearInterpolationOnSurface.h
index 9e98ec043a8..25774873a29 100644
--- a/NumLib/Function/LinearInterpolationOnSurface.h
+++ b/NumLib/Function/LinearInterpolationOnSurface.h
@@ -61,7 +61,7 @@ public:
 	 * @return interpolated value. A default value is returned if the given point
 	 * is not located on a surface
 	 */
-	double operator()(const MathLib::MathPoint& pnt) const;
+	double operator()(const MathLib::Point3d& pnt) const;
 
 private:
 	/// rotate a triangle to XY plane
diff --git a/NumLib/Function/TemplateSpatialFunction.h b/NumLib/Function/TemplateSpatialFunction.h
index d7c3f0ccda0..8dff6611cfc 100644
--- a/NumLib/Function/TemplateSpatialFunction.h
+++ b/NumLib/Function/TemplateSpatialFunction.h
@@ -39,7 +39,7 @@ public:
 	 * @param pnt  a point object
 	 * @return evaluated value
 	 */
-	virtual double operator()(const MathLib::MathPoint& pnt) const
+	virtual double operator()(const MathLib::Point3d& pnt) const
 	{
 		return _f(pnt.getCoords());
 	}
diff --git a/Tests/GeoLib/TestBoundingSphere.cpp b/Tests/GeoLib/TestBoundingSphere.cpp
index d2fc8da4396..5cf7d3a1f4e 100644
--- a/Tests/GeoLib/TestBoundingSphere.cpp
+++ b/Tests/GeoLib/TestBoundingSphere.cpp
@@ -17,15 +17,15 @@
 #include "gtest/gtest.h"
 
 #include "GeoLib/MinimalBoundingSphere.h"
-#include "MathLib/MathPoint.h"
+#include "MathLib/Point3d.h"
 
 TEST(GeoLib, TestBoundingSphere)
 {
-    std::vector<MathLib::MathPoint*> pnts;
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{0,  0   , 0}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{2,  0   , 0}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{1,  0.1 , 0}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{1, -0.1 , 0}})));
+    std::vector<MathLib::Point3d*> pnts;
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{0,  0   , 0}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{2,  0   , 0}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{1,  0.1 , 0}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{1, -0.1 , 0}})));
 
     {
     /**
@@ -39,7 +39,7 @@ TEST(GeoLib, TestBoundingSphere)
      * Expected result is C=(1,0,0), r=1
      */
     GeoLib::MinimalBoundingSphere s(pnts);
-    MathLib::MathPoint center = s.getCenter();
+    MathLib::Point3d center = s.getCenter();
     ASSERT_NEAR(1.0, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.0, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.0, center[2], std::numeric_limits<double>::epsilon());
@@ -61,7 +61,7 @@ TEST(GeoLib, TestBoundingSphere)
      */
     (*pnts[2])[2] -= 1.4;
     GeoLib::MinimalBoundingSphere s(pnts);
-    MathLib::MathPoint center = s.getCenter();
+    MathLib::Point3d center = s.getCenter();
     ASSERT_NEAR(1.0, center[0], 0.0001);
     ASSERT_NEAR(0.0246, center[1], 0.0001);
     ASSERT_NEAR(-0.3446, center[2], 0.0001);
@@ -80,10 +80,10 @@ TEST(GeoLib, TestBoundingSphere)
     (*pnts[3])[0] = 0.0;
     (*pnts[3])[1] = 1.0;
     (*pnts[3])[2] = 0.0;
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{0, 0, 1}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{1, 0, 1}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{1, 1, 1}})));
-    pnts.push_back(new MathLib::MathPoint(std::array<double,3>({{0, 1, 0.9}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{0, 0, 1}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{1, 0, 1}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{1, 1, 1}})));
+    pnts.push_back(new MathLib::Point3d(std::array<double,3>({{0, 1, 0.9}})));
 
     {
     /**
@@ -91,7 +91,7 @@ TEST(GeoLib, TestBoundingSphere)
      * Expected result is C=(0.5,0.5,0.5), r=0.866
      */
     GeoLib::MinimalBoundingSphere s(pnts);
-    MathLib::MathPoint center = s.getCenter();
+    MathLib::Point3d center = s.getCenter();
     ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[2], std::numeric_limits<double>::epsilon());
@@ -105,7 +105,7 @@ TEST(GeoLib, TestBoundingSphere)
     (*pnts[7])[2] += 0.3;
     GeoLib::MinimalBoundingSphere s(pnts);
     {
-    MathLib::MathPoint center = s.getCenter();
+    MathLib::Point3d center = s.getCenter();
     ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.6, center[2], std::numeric_limits<double>::epsilon());
@@ -113,14 +113,14 @@ TEST(GeoLib, TestBoundingSphere)
     }
 
     /// Calculates the bounding sphere of points on a bounding sphere
-    std::vector<MathLib::MathPoint*> *sphere_points (s.getRandomSpherePoints(1000));
+    std::vector<MathLib::Point3d*> *sphere_points (s.getRandomSpherePoints(1000));
     GeoLib::MinimalBoundingSphere t(*sphere_points);
-    MathLib::MathPoint center = s.getCenter();
+    MathLib::Point3d center = s.getCenter();
     ASSERT_NEAR(0.5, center[0], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.5, center[1], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.6, center[2], std::numeric_limits<double>::epsilon());
     ASSERT_NEAR(0.9273, s.getRadius(), 0.0001);
 
     std::for_each(pnts.begin(), pnts.end(),
-        std::default_delete<MathLib::MathPoint>());
+        std::default_delete<MathLib::Point3d>());
 }
-- 
GitLab