// 积分方法求多边形/面状图形的面积
// 多边形坐标在 xys 中,点数在 nn 中
function AreaOfPolygon(xys: PXYArray; nn: integer):single;
var ii:integer;
ss: single;
begin
ss := 0;
for ii := 0 to nn-2 do
ss := ss + (xys^[ii].y+xys^[ii+1].y) * (xys^[ii].x-xys^[ii+1].x) / 2;
result := abs(ss);
end;