From 87f63a2d4ba7dcddd90e18bbca53e3a0ae063ff2 Mon Sep 17 00:00:00 2001 From: Pedro Machado Manhaes de Castro Date: Fri, 12 Sep 2008 15:09:19 +0000 Subject: [PATCH] Tunning the functor example on CK2 --- .../Circular_kernel_2/functor_has_on.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp b/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp index 0886269d882..ec0bcbe3a04 100644 --- a/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp +++ b/Circular_kernel_2/examples/Circular_kernel_2/functor_has_on.cpp @@ -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; };