\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)

CGAL 4.8 - 2D Arrangements

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
CGAL::Arr_algebraic_segment_traits_2< Coefficient >::Point_2 Class Reference

`#include <CGAL/Arr_algebraic_segment_traits_2.h>`

## Definition

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`. More...
Curve_2 | curve () const
| returns a `Curve_2` instance that `p`is 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

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.