mirror of https://github.com/CGAL/cgal
fix after review
This commit is contained in:
parent
1dc880d2a1
commit
8251bb9bac
|
|
@ -404,11 +404,10 @@ inline
|
|||
typename K::FT
|
||||
squared_distance(const Plane_3<K> & p1,
|
||||
const Plane_3<K> & 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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue