I had to implement the Haversine distance for a data mining home work as well. We were given a list of the worlds capitals and we had to use openstreetmap api to get the latitudes and longitudes.
Then we had to implement hierarchical agglomerative clustering by hand, only using the dendrogram function from scikit-learn.