Interactively calculate the centroid of triangle or polygon