diff --git a/MathLib/MathTools.cpp b/MathLib/MathTools.cpp index c9999f5a26337b29dab78bb7b77477d06cdb96eb..469c3ab0c033277b4801001d51c403e2bb701f45 100644 --- a/MathLib/MathTools.cpp +++ b/MathLib/MathTools.cpp @@ -51,4 +51,10 @@ double getAngle (const double p0[3], const double p1[3], const double p2[3]) return std::acos (scalarProduct<double,3> (v0,v1) / (std::sqrt(scalarProduct<double,3>(v0,v0)) * sqrt(scalarProduct<double,3>(v1,v1)))); } +double scalarTriple(Eigen::Vector3d const& u, Eigen::Vector3d const& v, + Eigen::Vector3d const& w) +{ + return u.cross(v).dot(w); +} + } // namespace MathLib diff --git a/MathLib/MathTools.h b/MathLib/MathTools.h index 361a1289c473298baaace868636b97c730add130..1dcd438834cc18ed5659847c4c73fcbe73ced38e 100644 --- a/MathLib/MathTools.h +++ b/MathLib/MathTools.h @@ -90,4 +90,8 @@ double calcProjPntToLineAndDists(MathLib::Point3d const& pp, * @return the angle between the edges */ double getAngle (const double p0[3], const double p1[3], const double p2[3]); + +/// Calculates the scalar triple (u x v) . w +double scalarTriple(Eigen::Vector3d const& u, Eigen::Vector3d const& v, + Eigen::Vector3d const& w); } // namespace MathLib diff --git a/MathLib/Vector3.cpp b/MathLib/Vector3.cpp deleted file mode 100644 index f9e80edb2cda9bcf4175c24b8774ee31555fead5..0000000000000000000000000000000000000000 --- a/MathLib/Vector3.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/** - * \file - * \copyright - * Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - */ - -#include "Vector3.h" - -namespace MathLib -{ - -double scalarTriple(Eigen::Vector3d const& u, Eigen::Vector3d const& v, - Eigen::Vector3d const& w) -{ - return u.cross(v).dot(w); -} - -} // end namespace MathLib diff --git a/MathLib/Vector3.h b/MathLib/Vector3.h index 51ccb328613d7e071cb776dfa63a5c197722a1ab..9b9985fa50dd5f3b6d9a2d4397c9d8b1bdeb118a 100644 --- a/MathLib/Vector3.h +++ b/MathLib/Vector3.h @@ -196,8 +196,4 @@ template <typename T1> TemplateVector3<T1> operator*( } using Vector3 = TemplateVector3<double>; - -/// Calculates the scalar triple (u x v) . w -double scalarTriple(Eigen::Vector3d const& u, Eigen::Vector3d const& v, - Eigen::Vector3d const& w); } // namespace MathLib