CGAL 6.0 - 2D Arrangements
Loading...
Searching...
No Matches
CGAL::Arr_algebraic_segment_traits_2< Coefficient >::Point_2 Class Reference

#include <CGAL/Arr_algebraic_segment_traits_2.h>

Definition

template<typename Coefficient>
class CGAL::Arr_algebraic_segment_traits_2< Coefficient >::Point_2

Models the ArrangementBasicTraits_2::Point_2 concept.

Represents points in \( \mathbb{R}^2\). Intersection points of algebraic curves are in general non-rational, so we need a data structure that is capable of representing arbitrary points with algebraic coordinates.

The traits class represents algebraic coordinates by the type Algebraic_real_1, which is a model of the AlgebraicReal_1 concept. A point \( p\) is stored by a triple \( (x,cv,arcno)\), where \( x\) is the \( x\)-coordinate of a point, \( cv\) is an instance of Curve_2 that contains the point, (and has no vertical line at \( x\)), and \( arcno\) is an int, denoting that \( p\) is met as the \(arcno\)-th point when shooting a vertical ray at \( x\), starting from \(-\infty\) (where counting starts with \( 0\)).

In addition to the methods listed below, the copy constructor and assignment operator for Point_2 objects are also supported.

The functor Construct_point_2 constructs Point_2 instances.

Modifiers

Algebraic_real_1 x () const
 returns the \( x\)-coordinate of p.
 
Algebraic_real_1 y () const
 returns the \( y\)-coordinates of p.
 
Curve_2 curve () const
 returns a Curve_2 instance that pis part of.
 
int arcno () const
 returns the arc number of p.
 
std::pair< double, double > to_double () const
 returns double-approximations of the \( x\)- and \( y\)-coordinates.
 

Member Function Documentation

◆ y()

template<typename Coefficient >
Algebraic_real_1 CGAL::Arr_algebraic_segment_traits_2< Coefficient >::Point_2::y ( ) const

returns the \( y\)-coordinates of p.

Attention: As described above, points are not stored by their \( y\)-coordinate in Algebraic_real_1 representation. In fact, this representation must be computed on demand, and might become quite costly for points defined by high-degree polynomials. Therefore, it is recommended to avoid to call this function as much as possible.