CGAL::area_2
Definition
The function area_2 computes the signed area of a polygon.
#include <CGAL/Polygon_2_algorithms.h>
template <class ForwardIterator, class Traits>
|
void
|
area_2 ( ForwardIterator first, ForwardIterator last, typename Traits::FT &result, Traits traits)
|
Computes the signed area of the polygon defined by the range of points
first ... last. The area is returned in the parameter
result. The sign is positive for counterclockwise polygons, negative for
clockwise polygons. If the polygon is not simple, the area is not well defined.
The functionality is also available by the polygon_area_2 function, which
returns the area instead of taking it as a parameter.
Requirements
- Traits is a model of the concept
PolygonTraits_2
.
Only the following members of this traits class are used:
- Compute_area_2 : Computes the signed area of the
oriented triangle defined by 3 Point_2 passed as arguments.
- FT
- compute_area_2_object
- ForwardIterator::value_type should be Traits::Point_2,
See Also
CGAL::polygon_area_2
PolygonTraits_2
CGAL::orientation_2
CGAL::Polygon_2<PolygonTraits_2, Container>