Banger library. Not sure how it compares to, say, kd-tree in terms of performance but it allows for plenty of primitives.
Reply on news.ycombinator.com