diff --git a/Distance_3/include/CGAL/squared_distance_3_2.h b/Distance_3/include/CGAL/squared_distance_3_2.h index 26972588ba0..bf85329715c 100644 --- a/Distance_3/include/CGAL/squared_distance_3_2.h +++ b/Distance_3/include/CGAL/squared_distance_3_2.h @@ -404,11 +404,10 @@ inline typename K::FT squared_distance(const Plane_3 & p1, const Plane_3 & p2) { - K k;; - if( k.compute_squared_length_3_object()( - k.construct_cross_product_vector_3_object()(p1.orthogonal_vector(), - p2.orthogonal_vector())) - != 0) + K k; + typename K::Construct_orthogonal_vector_3 ortho_vec = + k.construct_orthogonal_vector_3_object(); + if (!internal::is_null(internal::wcross(ortho_vec(p1), ortho_vec(p2), k), k)) return typename K::FT(0); else return internal::squared_distance(p1.point(), p2, k); diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp index 38abdd0b828..1413169832b 100644 --- a/Distance_3/test/Distance_3/test_distance_3.cpp +++ b/Distance_3/test/Distance_3/test_distance_3.cpp @@ -224,10 +224,10 @@ struct Test { void Pl_Pl() { 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(); 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 (Pl(-2, 1, 1, 0), Pl(2, 1, 3, 0), 0); }