Distance is a numerical description of how far apart objects are.
In physics or everyday discussion, distance may refer to a physical length, or an estimation based on other criteria (e.g. "two counties over"). In mathematics, a distance function or metric is a generalization of the concept of physical distance. A metric is a function that behaves according to a specific set of rules, and provides a concrete way of describing what it means for elements of some space to be "close to" or "far away from" each other. Some example distance functions are:
- Manhattan Distance (between two vectors)
- Euclidean Distance (between two vectors)
- Jaccard Distance (between two sets)
- Hamming Distance (between two binary strings or bit vectors)
In most cases, "distance from A to B" is interchangeable with "distance between B and A".
For a somewhat deeper discussion see wikipedia.