class MetricSpace::Metric

Difference between two values in one dimension

Protected Class Methods

difference(one, two, index) click to toggle source

Count difference between two points in selected dimension

# File lib/metric_space/metric.rb, line 8
def self.difference(one, two, index)
  ((one[index] || 0.0) - (two[index] || 0.0)).abs
end