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

[MathLib] Remove twice implemented functionality.

parent 71132611
No related branches found
No related tags found
No related merge requests found
......@@ -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]))
......
......@@ -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.
......
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