Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Conics Arrangement : Orientation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Conics Arrangement : Orientation


Chronological Thread 
  • From: Myirci <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Conics Arrangement : Orientation
  • Date: Mon, 11 Mar 2013 15:14:12 +0100

Thank you very much for the answer. I agree that (-4,2) to (-1,1) is CW but I used  (-4, -2) as a source point. I attached an image file to visualize the target and source points. According to this, could you please explain the output that I got with the sample code ?

Have a nice day

Murat

On Sat, Mar 9, 2013 at 5:48 PM, Efi Fogel <> wrote:
The parabolic arc from (-4,2) to (-1,1) is CW. If you choose CCW, you get the complement, which is divided at (0,0) into x-monotone arcs.


On Tue, Mar 5, 2013 at 2:44 PM, Myirci <> wrote:
Hi again,

No one has any idea? 

Have a nice week

Murat

On Thu, Feb 28, 2013 at 10:25 AM, Myirci <> wrote:
Hello,

I'm using conics arrangement and I've a difficulty to understand the orientation of the conics arcs. In the simple example below, I want to insert the parabola segment: { y² + x = 0, source (-4,-2), target(-1,1) } in to my arrangement. And according to my understanding, from source point to target, the direction must be CCW. However, in this case, the resultant arrangement has 3 vertices and 2 edges (which is unexpected for me). If I change the orientation to CW then, I get the expected output. Could you clarify my confusion? 

Output when orientation is CCW: 

3 vertices:

(-4 -2) - degree 1

(0 0) - degree 2

(-1 1) - degree 1

2 edges:

[{0*x^2 + -1*y^2 + 0*xy + -1*x + 0*y + 0} : (-4,-2) --ccw--> (0,0)]

[{0*x^2 + -1*y^2 + 0*xy + -1*x + 0*y + 0} : (0,0) --ccw--> (-1,1)]


Output when orientation is CW:

 

2 vertices:

(-4 -2) - degree 1

(-1 1) - degree 1

1 edges:

[{0*x^2 + 1*y^2 + 0*xy + 1*x + 0*y + 0} : (-4,-2) --cw--> (-1,1)]


Here is the code:

#include <CGAL/Cartesian.h>






#include <CGAL/CORE_algebraic_number_traits.h>






#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>






#include <CGAL/Segment_Delaunay_graph_2.h>






#include <CGAL/Segment_Delaunay_graph_traits_2.h>






#include <CGAL/Arr_conic_traits_2.h>






#include <CGAL/Arrangement_2.h>






#include "print_arrangement.hpp" // same as the arr_print.h







typedef CGAL::CORE_algebraic_number_traits  Nt_traits;






typedef Nt_traits::Rational                 Rational;






typedef Nt_traits::Algebraic                Algebraic;






typedef CGAL::Cartesian<Rational>           Rat_kernel;






typedef CGAL::Cartesian<Algebraic>          Alg_kernel;






typedef CGAL::Arr_conic_traits_2<






    Rat_kernel, Alg_kernel, Nt_traits>      Traits_2;






typedef Traits_2::Point_2                   Point_2;






typedef Traits_2::Curve_2                   Conic_arc_2;






typedef CGAL::Arrangement_2<Traits_2>       Arrangement_2;







int main() {






    Arrangement_2 conics_arr;
    Conic_arc_2 parabola_arc(0, 1, 0, 1, 0, 0, CGAL::COUNTERCLOCKWISE,






                              Point_2(-4, -2), Point_2(-1, 1));






    if(parabola_arc.is_valid()) {






        CGAL::insert(conics_arr, parabola_arc);






        print_arrangement(conics_arr);

}
    else { std::cerr << "Conic arc is not valid! " << std::endl; }






    return 0;







--
Murat Yirci



--
Murat Yirci



--
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/





--
Murat Yirci

Attachment: parabola.png
Description: PNG image




Archive powered by MHonArc 2.6.18.

Top of Page