CGAL 4.7 - 2D Generalized Barycentric Coordinates: CGAL::Barycentric_coordinates::Segment_coordinates_2< Traits > Class Template Reference

\( \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.7 - 2D Generalized Barycentric Coordinates

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members | Related Functions
CGAL::Barycentric_coordinates::Segment_coordinates_2< Traits > Class Template Reference
2D Generalized Barycentric Coordinates Reference

`#include <CGAL/Barycentric_coordinates_2/Segment_coordinates_2.h>`

## Definition

The class `Segment_coordinates_2` implements barycentric coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane.

This class is parameterized by a traits class `Traits`.

Template Parameters

  Traits | must be a model of the concept `BarycentricTraits_2`.

## Related Functions

(Note that these are not member functions.)
template<class Traits >
CGAL::cpp11::array< typename Traits::FT, 2 > | compute_segment_coordinates_2 (const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits=Traits())

## Types

typedef Traits::FT | FT
| Number type.
typedef Traits::Point_2 | Point_2
| Point type.
typedef unspecified_type | Vertex_range
| Range of vertices in a segment. More...

## Creation

| Segment_coordinates_2 (const Point_2 &first_vertex, const Point_2 &second_vertex, const Traits &b_traits=Traits())
| Creates the class `Segment_coordinates_2` that implements segment coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane. More...

## Computation

template<class OutputIterator >
boost::optional< OutputIterator > | operator() (const Point_2 &query_point, OutputIterator output)
| Computes segment barycentric coordinates for a chosen query point with respect to both vertices of the segment. More...

## Endpoint Accessors

const Vertex_range & | vertices () const
| Returns both vertices of the segment.
const Point_2 & | first_vertex () const
| Returns the first vertex of the segment.
const Point_2 & | second_vertex () const
| Returns the second vertex of the segment.

## Member Typedef Documentation

template<class Traits >

typedef unspecified_type CGAL::Barycentric_coordinates::Segment_coordinates_2< Traits >::Vertex_range

Range of vertices in a segment.

This type is a model of the concept `Range`. Its iterator type is `RandomAccessIterator`, and its value type is `Traits::Point_2`.

## Constructor & Destructor Documentation

template<class Traits >

CGAL::Barycentric_coordinates::Segment_coordinates_2< Traits >::Segment_coordinates_2 | ( | const Point_2 & | first_vertex,
|  | const Point_2 & | second_vertex,
|  | const Traits & | b_traits = `Traits()`
| ) |  |

Creates the class `Segment_coordinates_2` that implements segment coordinates with respect to an arbitrary non-degenerate segment along an arbitrary line in the plane.

The segment is given by its two vertices.

Precondition
  Segment is not degenerate.

## Member Function Documentation

template<class Traits >
template<class OutputIterator >

boost::optional<OutputIterator> CGAL::Barycentric_coordinates::Segment_coordinates_2< Traits >::operator() | ( | const Point_2 & | query_point,
|  | OutputIterator | output
| ) |  |

Computes segment barycentric coordinates for a chosen query point with respect to both vertices of the segment.

Computed coordinates are stored in the output iterator `output`.

## Friends And Related Function Documentation

template<class Traits >

CGAL::cpp11::array< typename Traits::FT, 2 > compute_segment_coordinates_2 | ( | const typename Traits::Point_2 & | first_vertex,
|  | const typename Traits::Point_2 & | second_vertex,
|  | const typename Traits::Point_2 & | query_point,
|  | const Traits & | barycentric_traits = `Traits()`
| ) |  |

related

This is a global function that takes both vertices of a segment and computes segment coordinates at a given query point with respect to these vertices.

Template Parameters

  Traits | must be a model of the concept `BarycentricTraits_2`.