Calculation of areas, inertia moments, and centroids of polygons