The class Arr_conic_traits_2<RatKernel,AlgKernel,NtTraits> is a model of the ArrangementTraits_2 concept and can be used to construct and maintain arrangements of bounded segments of algebraic curves of degree $$2 at most, also known as conic curves.
A general conic curve $$C is the locus of all points $$(x,y) satisfying the equation: $$r x^{2} + s y^{2} + t x y + u x + v y + w = 0, where:
A bounded conic arc is defined as either of the following:
A very useful subset of the set of conic arcs are line segments and circular arcs, as arrangements of circular arcs and line segments have some interesting applications (e.g. offsetting polygons, motion planning for a disc robot, etc.). Circular arcs and line segment are simpler objects and can be dealt with more efficiently than arbitrary arcs. For these reasons, it is possible to construct conic arcs from segments and from circles. Using these constructors is highly recommended: It is more straightforward and also speeds up the arrangement construction. However, in case the set of input curves contain only circular arcs and line segments, it is recommended to use the Arr_circle_segment_2 class to achieve faster running times.
In our representation, all conic coefficients (namely $$r, s, t, u, v, w) must be rational numbers. This guarantees that the coordinates of all arrangement vertices (in particular, those representing instersection points) are algebraic numbers of degree $$4 (a real number $$ is an algebraic number of degree $$d if there exist a polynomial $$p with integer coefficient of degree $$d such that $$p() = 0). We therefore require separate representations of the curve coefficients and the point coordiantes. The NtTraits should be instantiated with a class that defines nested Integer, Rational and Algebraic number types and supports various operations on them, yielding certified computation results (for example, it can convert rational numbers to algebraic numbers and can compute roots of polynomials with integer coefficients). The other template parameters, RatKernel and AlgKernel should be geometric kernels templated with the NtTraits::Rational and NtTraits::Algebraic number types, repectively. It is recommended to instantiate the CORE_algebraic_number_traits class as the NtTraits parameter, with Cartesian<NtTraits::Rational> and Cartesian<NtTraits::Algebraic> instantiating the two kernel types, respectively. The number types in this case are provided by the CORE library, with its ability to exactly represent simple algebraic numbers.
The traits class inherits its point type from AlgKernel::Point_2, and defines a curve and $$xmonotone curve types, as detailed below.
#include <CGAL/Arr_conic_traits_2.h>
The Curve_2 class nested within the conicarc traits can represent arbitrary conic arcs and support their construction in various ways. The copy and default constructor as well as the assignment operator are provided for conic arcs. In addition, an operator<< for the curves is defined for standard output streams.
 
constructs an arc corresponding to the line segment seg.
 
 
constructs an arc corresponding to the full circle circ
(note that this circle has a center point with rational coordinates
and rational squared radius).
 
 
constructs a circular arc supported by the circle circ, going
in the given orientation o from the source point ps to
its target point pt.
 
 
constructs a circular arc going from p1 (its source point)
through p2 to p3 (its target point). Note that all three
points have rational coordinates. The orientation of the arc is
determined automatically.
 
 
constructs a conic arc that corresponds to the full conic curve
$$r x^{2} + s y^{2} + t x y + u x + v y + w = 0.
 
 
constructs a conic arc supported by the conic curve
$$r x^{2} + s y^{2} + t x y + u x + v y + w = 0, going
in the given orientation o from the source point ps to
its target point pt.
 
 
constructs a conic arc going from p1 (its source point)
through p2, p3 and p4 (in this order) to p5
(its target point). Note that all five points have rational coordinates.
The orientation of the arc is determined automatically.
 
 
constructs a conic arc supported by the conic curve
$$r x^{2} + s y^{2} + t x y + u x + v y + w = 0, going
in the given orientation o from its source point to its target
point. In this case only some approximations of the endpoints
(app_ps and app_pt, repsectively) is available,
and their exact locations are given implicitly, specified by the
intersections of the supporting conic curve with
$$r_{1} x^{2} + s_{1} y^{2} + t_{1} x y + u_{1} x + v_{1} y + w_{1} = 0 and
$$r_{2} x^{2} + s_{2} y^{2} + t_{2} x y + u_{2} x + v_{2} y + w_{2} = 0, repsectively.

The six following methods return the coefficients of the supported conic, after their conversion to integer number (reprsented by the Integer type of the NtTraits class):

 returns the coefficient of $$x^{2}.  

 returns the coefficient of $$t^{2}.  

 returns the coefficient of $$x y.  

 returns the coefficient of $$x.  

 returns the coefficient of $$y.  

 returns the free coefficient.  


returns the source point of the arc.
 


returns the target point of the arc.
 

 returns the orientation of the arc.  

 return a bounding box of the arc a. 


sets a new source point for the conic arc.
 


sets a new target point for the conic arc.

The X_monotone_curve_2 class nested within the conicarc traits is used to represent $$xmonotone conic arcs. It inherits from the Curve_2 type, therefore supports the access methods and the operations listed above.
For efficiency reasons, we recommend users not to construct $$xmonotone conic arc directly, but rather use the Make_x_monotone_2 functor supplied by the conicarc traits class to convert conic curves to $$xmonotone curves.
 
converts the given arc to an $$xmonotone arc.


 returns the left (lexicographically smaller) endpoint of xa. 

 returns the right (lexicographically larger) endpoint of xa. 