Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Polygon

Algorithms

A number of algorithms on sequences of 2D points is supplied as global functions. The iterators InputIterator and ForwardIterator are expected to have an appropriate 2D point type as their value type.

template <class ForwardIterator>
ForwardIterator
CGAL_left_vertex_2 ( ForwardIterator first,
ForwardIterator last)
Returns the leftmost point from the range [first,last) with the smallest y-coordinate
Precondition: The value type of first and last is Point.

template <class ForwardIterator>
ForwardIterator
CGAL_right_vertex_2 ( ForwardIterator first,
ForwardIterator last)
Returns the rightmost point in the range [first,last) with the largest y-coordinate
Precondition: The value type of first and last is Point.

template <class ForwardIterator>
ForwardIterator
CGAL_top_vertex_2 ( ForwardIterator first,
ForwardIterator last)
Returns the topmost point from the range [first,last) with the largest x-coordinate
Precondition: The value type of first and last is Point.

template <class ForwardIterator>
ForwardIterator
CGAL_bottom_vertex_2 ( ForwardIterator first,
ForwardIterator last)
Returns the bottommost point from the range [first,last) with the smallest x-coordinate
Precondition: The value type of first and last is Point.

template <class InputIterator>
CGAL_Bbox_2
CGAL_bbox_2 ( InputIterator first,
InputIterator last)
Returns the smallest bounding box of the points in the range [first,last).
Precondition: The value type of first and last is Point. and the range [first,last) is not empty.

template <class ForwardIterator, class Numbertype>
void
CGAL_area_2 ( ForwardIterator first,
ForwardIterator last,
Numbertype& result)
Returns the area of the polygon formed by the points in the range [first,last).
Precondition: The value type of first and last is Point.

template <class ForwardIterator>
bool
CGAL_is_convex_2 ( ForwardIterator first,
ForwardIterator last)
Returns true if the polygon formed by the points in the range [first,last) is convex.
Precondition: The value type of first and last is Point.

template <class ForwardIterator>
bool
CGAL_is_simple_2 ( ForwardIterator first,
ForwardIterator last)
Returns true if the polygon formed by the points in the range [first,last) is simple.
Precondition: The value type of first and last is Point.

template <class Traits, class ForwardIterator>
CGAL_Oriented_side oriented_side ( Traits::Point q)
This determines the location of the point q with respect to the polygon formed by the points in the range [first,last). Returns CGAL_NEGATIVE_SIDE, CGAL_POSITIVE_SIDE, or CGAL_ON_ORIENTED_BOUNDARY, depending on where point q is.
Precondition: The value type of first and last is Point and the points in the range [first,last) form the vertices of a simple polygon.

template <class Traits, class ForwardIterator>
CGAL_Bounded_side bounded_side ( Traits::Point q)
Determines the location of the point q with respect to the polygon formed by the points in the range [first,last). Returns CGAL_ON_BOUNDED_SIDE, CGAL_ON_BOUNDARY or CGAL_ON_UNBOUNDED_SIDE, depending on where point q is.
Precondition: The value type of first and last is Point. and the points in the range [first,last) form the vertices of a simple polygon.

template <class ForwardIterator>
CGAL_Orientation
CGAL_orientation_2 ( ForwardIterator first,
ForwardIterator last)
Returns the orientation of the polygon formed by the points in the range [first,last). If the number of points is smaller than three, CGAL_COLLINEAR is returned.
Precondition: The value type of first and last is Point. and the points in the range [first,last) form the vertices of a simple polygon.


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. Mon, June 30, 1997.