Count distance between points in selected metric space
Add this line to your application's Gemfile:
gem 'metric_space'
And then execute:
$ bundle
Or install it yourself as:
$ gem install metric_space
point1 = {x: 1.0, y: 2.0, z: 3.0}
point2 = {x: 2.5, y: -1.0}
MetricSpace::BritishRails.distance(point1, point2)
MetricSpace::Euclidean.distance(point1, point2)
MetricSpace::Maximum.distance(point1, point2)
MetricSpace::Taxicab.distance(point1, point2)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request