diff --git a/Distance_3/include/CGAL/squared_distance_Segment_3_Segment_3.h b/Distance_3/include/CGAL/squared_distance_Segment_3_Segment_3.h index e2fb59ae0fa..ed967bce474 100644 --- a/Distance_3/include/CGAL/squared_distance_Segment_3_Segment_3.h +++ b/Distance_3/include/CGAL/squared_distance_Segment_3_Segment_3.h @@ -80,7 +80,7 @@ squared_distance(const typename K::Segment_3& s1, CGAL_assertion(d != 0); res.x = 0; - res.y = boost::algorithm::clamp(f/d, 0, 1); // (f - x*c) / d + res.y = boost::algorithm::clamp(f/d, 0, 1); // (f - x*c) / d res.squared_distance = CGAL::squared_distance(p1, p2 + res.y*v2); return res; @@ -90,7 +90,7 @@ squared_distance(const typename K::Segment_3& s1, CGAL_assertion(a != 0); res.y = 0; - res.x = boost::algorithm::clamp(e/a, 0, 1); // (e + y*c) / a + res.x = boost::algorithm::clamp(e/a, 0, 1); // (e + y*c) / a res.squared_distance = CGAL::squared_distance(p1 + res.x*v1, p2); return res; @@ -102,14 +102,14 @@ squared_distance(const typename K::Segment_3& s1, if(det == 0) res.x = 0; else - res.x = boost::algorithm::clamp((e*d - b*f) / det, 0, 1); + res.x = boost::algorithm::clamp((e*d - b*f) / det, 0, 1); FT xc = res.x*c; // res.y = (f - xc) / d, by definition, but building it up more efficiently if(f > xc) // y < 0 <=> f - xc / d < 0 <=> f - xc > 0 (since d is -||v2||) { res.y = 0; - res.x = boost::algorithm::clamp(e/a, 0, 1); // (e + y*c) / a + res.x = boost::algorithm::clamp(e/a, 0, 1); // (e + y*c) / a } else // y >= 0 { @@ -117,7 +117,7 @@ squared_distance(const typename K::Segment_3& s1, if(n < d) // y > 1 <=> n / d > 1 <=> n < d (once again, important to note that d is negative!) { res.y = 1; - res.x = boost::algorithm::clamp((e + c) / a, 0, 1); // (e + y*c) / a + res.x = boost::algorithm::clamp((e + c) / a, 0, 1); // (e + y*c) / a } else // 0 <= y <= 1 {