centroid function

Calculate the centroid of a track.