Calculates the centerline of a polygon