Browse Source

Area formula changed

master v1.0.0
Kolan Sh 9 years ago
parent
commit
b2b873acc8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      Polygon.c

+ 1
- 1
Polygon.c 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})
}


Loading…
Cancel
Save