A Geometric Approach to $k$-means