CGAL 6.1 - dD Frechet Distance
Loading...
Searching...
No Matches
Frechet_distance/Frechet_distance_2.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Frechet_distance.h>
#include <CGAL/IO/WKT.h>
#include <ostream>
#include <fstream>
using Point = Kernel::Point_2;
int main(int argc, char* argv[])
{
std::vector<Point> A, B;
{
std::ifstream in((argc > 1) ? argv[1] : CGAL::data_file_path("wkt/LetterA.wkt"));
}
{
std::ifstream in((argc > 1) ? argv[2] : CGAL::data_file_path("wkt/LetterAbis.wkt"));
}
bool res = CGAL::is_Frechet_distance_larger(A, B, 0.001);
std::cout << std::boolalpha << res << std::endl;
return 0;
}
bool is_Frechet_distance_larger(const PointRange &polyline1, const PointRange &polyline2, const double distance_bound, const NamedParameters &np=parameters::default_values())
determines if the Frechet distance between two polylines is larger than a given distance bound.
Definition: Frechet_distance.h:110
bool read_linestring_WKT(std::istream &in, LineString &polyline)
std::string data_file_path(const std::string &filename)