CGAL::ch_jarvis
Definition
The function ch_jarvis generates the counterclockwise sequence of extreme
points from a given set of input points.
#include <CGAL/ch_jarvis.h>
template <class InputIterator, class OutputIterator, class Traits>
|
OutputIterator
|
ch_jarvis ( |
InputIterator first,
InputIterator beyond,
OutputIterator result,
Traits ch_traits = Default_traits) |
|
| |
generates the counterclockwise sequence of extreme points
of the points in the range [first,beyond).
The resulting sequence is placed starting at position
result, and the past-the-end iterator for the resulting
sequence is returned. It is not specified at which point the
cyclic sequence of extreme points is cut into a linear sequence.
Precondition: | The source range [first,beyond) does not contain
result. |
|
The default traits class Default_traits is the kernel in which the
type InputIterator::value_type is defined.
Requirements
- InputIterator::value_type and
OutputIterator::value_type
are equivalent to Traits::Point_2.
- Traits defines the following subset of types from
the concept ConvexHullTraits_2 and their corresponding member
functions that return instances of these types:
- Traits::Point_2,
- Traits::Equal_2,
- Traits::Less_rotate_ccw_2,
- Traits::Less_xy_2.
See Also
CGAL::ch_akl_toussaint
CGAL::ch_bykat
CGAL::ch_eddy
CGAL::ch_graham_andrew
CGAL::ch_jarvis_march
CGAL::ch_melkman
CGAL::convex_hull_2
Implementation
This function uses the Jarvis march (gift-wrapping)
algorithm [Jar73]. This algorithm requires time
in the worst case for input points with extreme points.