centroid function now also accounts for the control points in a curve.

This solves issue 59 in maak.