FunctionObjectClass

CGAL::Is_convex_2<Traits>

Definition

Function object class for testing if a sequence of points represents a convex polygon or not.

#include <CGAL/polygon_function_objects.h>

Is Model for the Concepts

PolygonIsValid

Creation

Is_convex_2<Traits> f ( Traits t);
Traits satisfies the requirements of the function is_convex_2

Operations

template<class InputIterator>
bool f ( InputIterator first , InputIterator beyond )
returns true iff the points of type Triats::Point_2 in the range [first,beyond) define a convex polygon.

See Also

CGAL::convex_partition_is_valid_2
CGAL::Partition_is_valid_traits_2<Traits, PolygonIsValid>

Implementation

This test requires O(n) time for a polygon with n vertices.