CGAL 6.1.1 - 2D Arrangements

Loading...
Searching...
No Matches
List of all members
CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2 Class Reference

`#include <CGAL/Arr_Bezier_curve_traits_2.h>`

## Definition

template<typename RatKernel, typename AlgKernel, typename NtTraits>
class CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2

The `Point_2` class nested within the Bézier traits class is used to represent: (i) an endpoint of a Bézier curve, (ii) a vertical tangency point of a curve, used to subdivide it into \(x\)-monotone subcurve, and (iii) an intersection point between two curves.

While, points of type (i) have rational coordinates and are given as part of the input, points of the two latter types have algebraic coordinates. However, to speed up the arrangement construction, such point are not computed in an exact manner, and instead are given in an approximate representation. Note that the exact coordinates of a point may only be accessed if it is exactly computed.

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

## Creation
| Point_2 ()
| default constructor.
| Point_2 (const Curve_2 &B, const Algebraic &t_0)
| constructs the point \(B(t_0)\) on the given curve.
| Point_2 (const Curve_2 &B, const Rational &t_0)
| constructs the point \(B(t_0)\) on the given curve.

## Access Functions
std::pair< double, double > | approximate () const
| returns the approximated coordinates of `p`.
bool | is_exact () const
| returns whether the coordinates of `p` are computed in an exact manner.
Algebraic | x () const
| returns the \(x\)-coordinate of `p`.
Algebraic | y () const
| returns the \(y\)-coordinate of `p`.
bool | is_rational () const
| returns whether the coordinates of `p` are rational numbers.
| operator typename RatKernel::Point_2 () const
| casts `p` to a point with rational coordinates.

## Constructor & Destructor Documentation

## ◆ Point_2() [1/2]

template<typename RatKernel , typename AlgKernel , typename NtTraits >

CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2::Point_2 | ( | const Curve_2 & | B,
|  | const Algebraic & | t_0
| ) |  |

constructs the point \(B(t_0)\) on the given curve.

As \(t_0\) is an algebraic number, the point has algebraic coordinates.

## ◆ Point_2() [2/2]

template<typename RatKernel , typename AlgKernel , typename NtTraits >

CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2::Point_2 | ( | const Curve_2 & | B,
|  | const Rational & | t_0
| ) |  |

constructs the point \(B(t_0)\) on the given curve.

As \(t_0\) is a rational number, the point has rational coordinates.

## Member Function Documentation

## ◆ operator typename RatKernel::Point_2()

template<typename RatKernel , typename AlgKernel , typename NtTraits >

CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2::operator typename RatKernel::Point_2 | ( |  | ) | const

casts `p` to a point with rational coordinates.

Precondition
  `p` has rational coordinates.

## ◆ x()

template<typename RatKernel , typename AlgKernel , typename NtTraits >

Algebraic CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2::x | ( |  | ) | const

returns the \(x\)-coordinate of `p`.

Precondition
  `p` is exactly computed.

## ◆ y()

template<typename RatKernel , typename AlgKernel , typename NtTraits >

Algebraic CGAL::Arr_Bezier_curve_traits_2< RatKernel, AlgKernel, NtTraits >::Point_2::y | ( |  | ) | const

returns the \(y\)-coordinate of `p`.

Precondition
  `p` is exactly computed.