Tunning the functor example on CK2

This commit is contained in:
Pedro Machado Manhaes de Castro 2008-09-12 15:09:19 +00:00
parent 3ac5443b35
commit 87f63a2d4b
1 changed files with 10 additions and 7 deletions

View File

@ -10,15 +10,18 @@ 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 = 1; i <= 5; i++) {
for(int j = 1; j <= 10; j++) {
for(int i = 0; i <= 10; i++) {
for(int j = 0; j <= 10; j++) {
Point_2 p = Point_2(i, j);
if(Circular_k().has_on_2_object()(c,p)) n++;
if(Circular_k().has_on_2_object()(c,p)) {
n++;
std::cout << "(" << i << "," << j << ")" << std::endl;
}
}
}
std::cout << "There are " << n << " points in the 10x5 grid on the circular"
<< std::endl
<< " arc with endpoints (0,0), (10,0) defined on the superior half plane"
<< 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;
};