#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h>
namespace BC = CGAL::Barycentric_coordinates;
using std::cout; using std::endl; using std::string;
int main()
{
const Point first_vertex(0, Scalar(2)/Scalar(5));
const Point second_vertex(2, Scalar(2)/Scalar(5));
const Point query_points[5] = { Point(Scalar(2) /Scalar(5), Scalar(2)/Scalar(5)),
Point(1 , Scalar(2)/Scalar(5)),
Point(Scalar(8) /Scalar(5), Scalar(2)/Scalar(5)),
Point(Scalar(-1)/Scalar(5), Scalar(2)/Scalar(5)),
Point(Scalar(11)/Scalar(5), Scalar(2)/Scalar(5))
};
cout << endl << "Computed segment coordinates: " << endl << endl;
for(int i = 0; i < 5; ++i) {
const Pair pair = BC::compute_segment_coordinates_2(first_vertex, second_vertex, query_points[i],
Kernel());
cout << "Pair of coordinates # " << i + 1 << " = (" << pair[0] << ", " << pair[1] << ");" << endl;
}
cout << endl;
return EXIT_SUCCESS;
}