mirror of https://github.com/CGAL/cgal
More tests
This commit is contained in:
parent
d048a50f57
commit
36c800688d
|
|
@ -208,6 +208,36 @@ private:
|
||||||
check_squared_distance (p(1, 1, 1), t, 1);
|
check_squared_distance (p(1, 1, 1), t, 1);
|
||||||
check_squared_distance (p(1, 0, 1), t, 1);
|
check_squared_distance (p(1, 0, 1), t, 1);
|
||||||
check_squared_distance (p(0, 0, 1), t, 1);
|
check_squared_distance (p(0, 0, 1), t, 1);
|
||||||
|
|
||||||
|
// Degenerate
|
||||||
|
check_squared_distance (p(1, 2, 3), T(p(4,3,2), p(4,3,2), p(4,3,2)), squared_distance(p(1, 2, 3), p(4,3,2)));
|
||||||
|
check_squared_distance (p(1, 2, 3), T(p(4,3,2), p(10,12,3), p(4,3,2)), squared_distance(p(1, 2, 3), p(4,3,2)));
|
||||||
|
check_squared_distance (p(0, 0, 0), T(p(4,3,2), p(4,-3,-2), p(4,3,2)), squared_distance(p(0, 0, 0), p(4,0,0)));
|
||||||
|
|
||||||
|
// On the triangle
|
||||||
|
check_squared_distance (p(7, 1, -5), T(p(2,9,8), p(-4,-3,-5), p(7, 1, -5)), 0); // vertex
|
||||||
|
check_squared_distance (p(7, 1, -5), T(p(14,2,-10), p(-7,-1,5), p(8, 3, -1)), 0); // edge
|
||||||
|
check_squared_distance (p(1, 4, -3), T(p(0,-8,-3), p(-5,14,-3), p(10, 1, -3)), 0); // face
|
||||||
|
|
||||||
|
// General
|
||||||
|
check_squared_distance (p(-15, 1, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 25);
|
||||||
|
check_squared_distance (p(-5, 0, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(-5, 0, 0), S(p(-10, 1, 0), p(0,0,0))));
|
||||||
|
check_squared_distance (p(0, -3, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 9);
|
||||||
|
check_squared_distance (p(3, -3, 0), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(3, -3, 0), S(p(0,0,0), p(10,0,0))));
|
||||||
|
check_squared_distance (p(16, 1, 1), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), 38);
|
||||||
|
check_squared_distance (p(5, 5, 2), T(p(-10, 1, 0), p(0,0,0), p(10,0,0)), squared_distance(p(5, 5, 2), S(p(10,0,0), p(-10,1,0))));
|
||||||
|
|
||||||
|
for(int i=0; i<N; ++i)
|
||||||
|
{
|
||||||
|
P p0 = random_point();
|
||||||
|
P p1 = random_point();
|
||||||
|
P p2 = random_point();
|
||||||
|
P q = random_point();
|
||||||
|
|
||||||
|
check_squared_distance_with_bound(q, T(p0, p1, p2), squared_distance(q, S(p0, p1)));
|
||||||
|
check_squared_distance_with_bound(q, T(p0, p1, p2), squared_distance(q, S(p1, p2)));
|
||||||
|
check_squared_distance_with_bound(q, T(p0, p1, p2), squared_distance(q, S(p2, p0)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_Tet()
|
void P_Tet()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue