ocmath_l_polygon_area

 

Contents

Description

calculate polygon area for type POINT.

In this function, divide the polygon into trapezias by both ends of polygon's borders, then for every trapezia, calculate its area by (y1+y2)*(x2-x1)/2.

Data types supported:

double: ocmath_d_polygon_area

float: ocmath_f_polygon_area

POINT: ocmath_l_polygon_area

Syntax

LONG ocmath_l_polygon_area(const POINT* pts, UINT nSize)

Parameters

pts
[input] buffer containing points
nSize
[input] size of points

Return

Polygon area.

Examples

Remark

See Also

ocmath_d_polygon_area, ocmath_f_polygon_area

header to Include

origin.h

Reference