diff --git a/Frechet_distance/examples/Frechet_distance/Frechet_distance_3.cpp b/Frechet_distance/examples/Frechet_distance/Frechet_distance_3.cpp index aef7d50fa39..c73ce7fa11f 100644 --- a/Frechet_distance/examples/Frechet_distance/Frechet_distance_3.cpp +++ b/Frechet_distance/examples/Frechet_distance/Frechet_distance_3.cpp @@ -1,17 +1,20 @@ #include #include #include +#include #include #include #include -using Kernel = CGAL::Simple_cartesian; +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +//using Kernel = CGAL::Simple_cartesian; using Traits = CGAL::Frechet_distance_traits_3; using Point = Traits::Point_d; int main(int argc, char* argv[]) { +#if 0 std::vector A, B; { std::ifstream in(CGAL::data_file_path("wkt/moebius.wkt")); @@ -21,6 +24,14 @@ int main(int argc, char* argv[]) std::ifstream in(CGAL::data_file_path("wkt/moebius2.wkt")); CGAL::IO::read_linestring_WKT(in, B); } + #else + + // two identical points fails + std::array A = { Point(0,0,0), Point(0,0,0), Point(1,0,1), Point(1,1,0)}; + std::array B = { Point(0,0,0), Point(0,0,0), Point(1,0,0), Point(1,1,0)}; + +#endif + std::pair res = CGAL::approximate_Frechet_distance(A, B, 0.000001); std::cout << "The Frechet distance between the polylines is between " << res.first << " and " << res.second << std::endl; return 0;