boostorg/geometry — pull request #155 by awulkiew (2014-10-10 23:01:59+00:00)
Title: Fix/centroid

Fix for Geometries containing big coordinates values.

During the calculation of a centroid the strategy may perform calculus using great values, e.g. add squares of coordinates, which greately increases the numerical error. This is related with https://github.com/boostorg/geometry/pull/154.

The main idea is to move the Geometry closer to 0 and calculate the centroid for such Geometry. The new origin is the first Point of a Geometry. The translation is done on-the-fly as centroid is calculated. Then the resulting point is translated back.

The picture below shows the Polygon placed closer to 0 and further, plus their centroids before and after the fix.

![text3152](https://cloud.githubusercontent.com/assets/1226951/4600161/6b8980e8-50cf-11e4-8b71-67eac62defb0.png)