RoR App - Location Search Gem/Algorithm?

Take a look at this: http://en.wikipedia.org/wiki/Great-circle_distance