Created function to calc centroid of CS in polar