To talk about ``close'' and ``far'' in a consistent manner, we need to have the concept of a distance metric. A distance metric, is a function or algorithm for calculating a distance between two things, and . It has three properties:

- It is always positive or zero.
- The distance from a thing
^{2}to itself is zero. - It obeys the triangle inequality:
For any three points, , , and ,
for any possible choice of .
In other words, the straight line between
and , which has a length ,
is shorter
^{3}than any other path between and , such as a path that goes by way of .

(1) |

(2) |

Greg Kochanski 2004-02-14