CGAL 6.1 - dD Frechet Distance
Loading...
Searching...
No Matches
Frechet_distance/Frechet_distance_3.cpp
#include <CGAL/Frechet_distance.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/WKT.h>
#include <ostream>
#include <fstream>
using Point = Kernel::Point_3;
int main(int argc, char* argv[])
{
std::vector<Point> A, B;
{
std::ifstream in((argc > 1) ? argv[1] : CGAL::data_file_path("wkt/moebius.wkt"));
}
{
std::ifstream in((argc > 2) ? argv[2] : CGAL::data_file_path("wkt/moebius2.wkt"));
}
std::pair<double, double> res = CGAL::bounded_error_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;
}
std::pair< double, double > bounded_error_Frechet_distance(const PointRange &polyline1, const PointRange &polyline2, const double error_bound, const NamedParameters &np=parameters::default_values())
returns an estimate of the Fréchet distance between the two polylines that is at most error_bound.
Definition: Frechet_distance.h:170
bool read_linestring_WKT(std::istream &in, LineString &polyline)
std::string data_file_path(const std::string &filename)