An interface to calculate a distance measure between two objects. A distance
function maps pairs of points into the nonnegative reals and has to satisfy
- non-negativity: d(x, y) ≥ 0
- isolation: d(x, y) = 0 if and only if x = y
- symmetry: d(x, y) = d(x, y)
.
Note that a distance function is not required to satisfy triangular inequality
|x - y| + |y - z| ≥ |x - z|, which is necessary for a metric.