Changed angularDist to use a numerically-improved distance function