Skip to content
Snippets Groups Projects
Commit 4f74e72b authored by Tom Fischer's avatar Tom Fischer
Browse files

[MaL] Move scalarTriple to MathTools.

parent a13f35f8
No related branches found
No related tags found
No related merge requests found
...@@ -51,4 +51,10 @@ double getAngle (const double p0[3], const double p1[3], const double p2[3]) ...@@ -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)))); 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 } // namespace MathLib
...@@ -90,4 +90,8 @@ double calcProjPntToLineAndDists(MathLib::Point3d const& pp, ...@@ -90,4 +90,8 @@ double calcProjPntToLineAndDists(MathLib::Point3d const& pp,
* @return the angle between the edges * @return the angle between the edges
*/ */
double getAngle (const double p0[3], const double p1[3], const double p2[3]); 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 } // namespace MathLib
/**
* \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
...@@ -196,8 +196,4 @@ template <typename T1> TemplateVector3<T1> operator*( ...@@ -196,8 +196,4 @@ template <typename T1> TemplateVector3<T1> operator*(
} }
using Vector3 = TemplateVector3<double>; 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 } // namespace MathLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment