Area formula changed

This commit is contained in:
Kolan Sh 2012-05-03 16:04:04 +04:00
parent 8bc5c25008
commit b2b873acc8
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ double __Polygon_area (const Polygon *this)
this->points[(i + 1) % this->npoints].x * this->points[i].y;
}
return s * 0.5;
return fabs (s) * 0.5;
// Trapezium rule for convex and non-convex polygons
// S=abs(сумма{(x[i+1]-x[i])*(y[i+1]+y[i])/2})
}