diff --git a/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt b/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt index a4bcd1d8107..e7b39f5c061 100644 --- a/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt +++ b/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt @@ -53,8 +53,8 @@ as well as `Epick_d` and `Epeck_d`, the computation is filtered and hence both f \section secFrechetDistanceImplementation Implementation -The algorithms in this package are an adaption of the implementation of \cgalCite{cgal:bkn-wdfp-19} -and \cgalCite{cgal:bkn-wdfp-21}. In particular, the implementation can decide non-difficult cases very +The algorithms in this package are an adaption of the implementation devised by Bringmann et al. (\cgalCite{cgal:bkn-wdfp-19} +and \cgalCite{cgal:bkn-wdfp-21}). In particular, the implementation can decide non-difficult cases very fast while for difficult cases it still has the quadratic running time guarantee of the classical Fréchet distance algorithm by Alt and Godau cgalCite{ag-cfdbt-95}. This is achieved by using fast bounding box filtering methods and a divide and conquer algorithm with pruning rules on the free-space diagram. @@ -67,8 +67,8 @@ can be used with either inexact or exact kernels. \subsection subsecFrechetDistanceFirstExample Decision for 2D Polylines -The following example shows how we can use `is_Frechet_distance_larger()` to decide whether the Fréchet -distance between two polylines in the Euclidean plane is at most a given value. +The following example shows how we can use `is_Frechet_distance_larger()` +to determines if the Frechet distance between two polylines is larger than a given distance bound. \cgalExample{Frechet_distance/Frechet_distance_2.cpp} diff --git a/Frechet_distance/examples/Frechet_distance/Frechet_distance_2.cpp b/Frechet_distance/examples/Frechet_distance/Frechet_distance_2.cpp index 9eaf0c7a33b..9815ce0032b 100644 --- a/Frechet_distance/examples/Frechet_distance/Frechet_distance_2.cpp +++ b/Frechet_distance/examples/Frechet_distance/Frechet_distance_2.cpp @@ -10,16 +10,16 @@ using Point = Kernel::Point_2; int main(int argc, char* argv[]) { - std::vector A, B; + std::vector polylineA, polylineB; { std::ifstream in((argc > 1) ? argv[1] : CGAL::data_file_path("wkt/LetterA.wkt")); - CGAL::IO::read_linestring_WKT(in, A); + CGAL::IO::read_linestring_WKT(in, polylineA); } { std::ifstream in((argc > 1) ? argv[2] : CGAL::data_file_path("wkt/LetterAbis.wkt")); - CGAL::IO::read_linestring_WKT(in, B); + CGAL::IO::read_linestring_WKT(in, polylineB); } - bool res = CGAL::is_Frechet_distance_larger(A, B, 0.001); + bool res = CGAL::is_Frechet_distance_larger(polylineA, polylineB, 0.001); std::cout << std::boolalpha << res << std::endl; return 0; } diff --git a/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp b/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp index cb27fdbbdba..209827022bc 100644 --- a/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp +++ b/Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp @@ -9,10 +9,10 @@ using Point = Kernel::Point_d; int main() { - std::array A = { Point(0,0,0,0), Point(1,0,0,0), Point(1,1,0,1),Point(1,1,1,0)}; - std::array B = { Point(0,0,0,0), Point(1,0,0,0), Point(1,1,0,0),Point(1,1,1,0)}; + std::array polylineA = { Point(0,0,0,0), Point(1,0,0,0), Point(1,1,0,1),Point(1,1,1,0)}; + std::array polylineB = { Point(0,0,0,0), Point(1,0,0,0), Point(1,1,0,0),Point(1,1,1,0)}; - std::pair res = CGAL::bounded_error_Frechet_distance(A, B, 0.000001); + std::pair res = CGAL::bounded_error_Frechet_distance(polylineA, polylineB, 0.000001); std::cout << "The Frechet distance between the polylines is between " << res.first << " and " << res.second << std::endl; return 0; }