CGAL 6.2 - 2D Circular Geometry Kernel

Loading...
Searching...
No Matches
Circular_kernel_2/functor_has_on_2.cpp
#include <CGAL/Exact_circular_kernel_2.h>
#include <iostream>
typedef CGAL::Exact_circular_kernel_2 Circular_k;
typedef CGAL::Point_2<Circular_k> Point_2;
typedef CGAL::Circular_arc_2<Circular_k> Circular_arc_2;
typedef CGAL::Circular_arc_point_2<Circular_k> Circular_arc_point_2;
int main()
{
int n = 0;
Circular_arc_2 c = Circular_arc_2(Point_2(10,0), Point_2(5,5), Point_2(0, 0));
for(int i = 0; i <= 10; i++) {
for(int j = 0; j <= 10; j++) {
Circular_arc_point_2 cap(Point_2(i, j));
if(Circular_k().has_on_2_object()(c,cap)) {
n++;
std::cout << "(" << i << "," << j << ")" << std::endl;
}
}
}
std::cout << "There are " << n << " points in the [0,..,10]x[0,..,10] "
<< "grid on the circular" << std::endl
<< " arc defined counterclockwisely by the points (0,0), (5,5), (10,0)"
<< std::endl << "See the points above." << std::endl;
return 0;
}
CGAL::Circular_arc_2
Definition: Circular_arc_2.h:14
CGAL::Circular_arc_point_2
Definition: Circular_arc_point_2.h:14
CGAL::Exact_circular_kernel_2
A typedef to a circular kernel that provides both exact geometric predicates and exact geometric cons...
Definition: Exact_circular_kernel_2.h:17
CGAL::Point_2