AFAIK this is pretty slow , but I'm not sure how many points you are using and if speed is an issue. You could use `BallTree` from scikit-learn to speed things up.