From 54f5e7a36acfe9881264bd8db8c4bc4d1525ee3a Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 2 Jun 2014 14:47:26 +0200 Subject: [PATCH] [MathLib] Remove twice implemented functionality. --- MathLib/MathTools.cpp | 17 ----------------- MathLib/MathTools.h | 6 ------ 2 files changed, 23 deletions(-) diff --git a/MathLib/MathTools.cpp b/MathLib/MathTools.cpp index 651fa75369b..a086660e996 100644 --- a/MathLib/MathTools.cpp +++ b/MathLib/MathTools.cpp @@ -62,23 +62,6 @@ double getAngle (const double p0[3], const double p1[3], const double p2[3]) return acos (scalarProduct<double,3> (v0,v1) / (sqrt(scalarProduct<double,3>(v0,v0)) * sqrt(scalarProduct<double,3>(v1,v1)))); } -double calcTriangleArea(const double* p0, const double* p1, const double* p2) -{ - const double u0 (p2[0] - p0[0]); - const double u1 (p2[1] - p0[1]); - const double u2 (p2[2] - p0[2]); - - const double v0 (p1[0] - p0[0]); - const double v1 (p1[1] - p0[1]); - const double v2 (p1[2] - p0[2]); - - const double z0 (u1 * v2 - u2 * v1); - const double z1 (u2 * v0 - u0 * v2); - const double z2 (u0 * v1 - u1 * v0); - - return 0.5 * sqrt(z0 * z0 + z1 * z1 + z2 * z2); -} - double calcTetrahedronVolume(const double* x1, const double* x2, const double* x3, const double* x4) { return fabs((x1[0] - x4[0]) * ((x2[1] - x4[1]) * (x3[2] - x4[2]) - (x2[2] - x4[2]) * (x3[1] - x4[1])) diff --git a/MathLib/MathTools.h b/MathLib/MathTools.h index 585d141b14c..8c78efca616 100644 --- a/MathLib/MathTools.h +++ b/MathLib/MathTools.h @@ -148,12 +148,6 @@ float normalize(float min, float max, float val); */ double getAngle (const double p0[3], const double p1[3], const double p2[3]); -/** - * Calculates the area of a triangle. - * The formula is A=.5*|u x v|, i.e. half of the area of the parallelogram specified by u=p0->p1 and v=p0->p2. - */ -double calcTriangleArea(const double* p0, const double* p1, const double* p2); - /** * Calculates the volume of a tetrahedron. * The formula is V=1/6*|a(b x c)| with a=x1->x2, b=x1->x3 and c=x1->x4. -- GitLab