fix after review

This commit is contained in:
Maxime Gimeno 2019-10-25 11:21:05 +02:00
parent 1dc880d2a1
commit 8251bb9bac
2 changed files with 6 additions and 7 deletions

View File

@ -404,11 +404,10 @@ inline
typename K::FT typename K::FT
squared_distance(const Plane_3<K> & p1, squared_distance(const Plane_3<K> & p1,
const Plane_3<K> & p2) { const Plane_3<K> & p2) {
K k;; K k;
if( k.compute_squared_length_3_object()( typename K::Construct_orthogonal_vector_3 ortho_vec =
k.construct_cross_product_vector_3_object()(p1.orthogonal_vector(), k.construct_orthogonal_vector_3_object();
p2.orthogonal_vector())) if (!internal::is_null(internal::wcross(ortho_vec(p1), ortho_vec(p2), k), k))
!= 0)
return typename K::FT(0); return typename K::FT(0);
else else
return internal::squared_distance(p1.point(), p2, k); return internal::squared_distance(p1.point(), p2, k);

View File

@ -224,10 +224,10 @@ struct Test {
void Pl_Pl() void Pl_Pl()
{ {
std::cout << "Plane - Plane\n"; std::cout << "Plane - Plane\n";
Pl p1(12, 1, 4, 0); Pl p1(0, 1, 0, 0);
typename K::Vector_3 v = -p1.orthogonal_vector(); typename K::Vector_3 v = -p1.orthogonal_vector();
v /= CGAL::sqrt(v.squared_length()); v /= CGAL::sqrt(v.squared_length());
Pl p2 = Pl(p1.point()+6*v, -p1.orthogonal_vector()); Pl p2 = Pl(0,-1,0,6);
check_squared_distance (p1,p2, 36); check_squared_distance (p1,p2, 36);
check_squared_distance (Pl(-2, 1, 1, 0), Pl(2, 1, 3, 0), 0); check_squared_distance (Pl(-2, 1, 1, 0), Pl(2, 1, 3, 0), 0);
} }