The distance between physical locations can be defined in different ways in different contexts.
Straight-line or Euclidean distance The distance between two points in physical
space is the
length of a
straight line between them, which is the shortest possible path. This is the usual meaning of distance in
classical physics, including
Newtonian mechanics. Straight-line distance is formalized mathematically as the
Euclidean distance in
two- and
three-dimensional space. In
Euclidean geometry, the distance between two points and is often denoted |AB|. In
coordinate geometry, Euclidean distance is computed using the
Pythagorean theorem. The distance between points and in the plane is given by: d=\sqrt{(\Delta x)^2+(\Delta y)^2}=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}. Similarly, given points (
x1,
y1,
z1) and (
x2,
y2,
z2) in three-dimensional space, the distance between them is: d=\sqrt{(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}. This idea generalizes to higher-dimensional
Euclidean spaces.
Measurement There are many ways of
measuring straight-line distances. For example, it can be done directly using a
ruler, or indirectly with a
radar (for long distances) or
interferometry (for very short distances). The
cosmic distance ladder is a set of ways of measuring extremely long distances.
Shortest-path distance on a curved surface and
Tokyo approximately follow a
great circle going west (top) but use the
jet stream (bottom) when heading eastwards. The shortest route appears as a curve rather than a straight line because the
map projection does not scale all distances equally compared to the real spherical surface of the Earth. The straight-line distance between two points on the surface of the Earth is not very useful for most purposes, since we cannot tunnel straight through the
Earth's mantle. Instead, one typically measures the shortest path along the
surface of the Earth,
as the crow flies. This is approximated mathematically by the
great-circle distance on a sphere. More generally, the shortest path between two points along a
curved surface is known as a
geodesic. The
arc length of geodesics gives a way of measuring distance from the perspective of an
ant or other flightless creature living on that surface.
Effects of relativity In the
theory of relativity, because of phenomena such as
length contraction and the
relativity of simultaneity, distances between objects depend on a choice of
inertial frame of reference. On galactic and larger scales, the measurement of distance is also affected by the
expansion of the universe. In practice, a number of
distance measures are used in
cosmology to quantify such distances.
Other spatial distances on a grid Unusual definitions of distance can be helpful to model certain physical situations, but are also used in theoretical mathematics: • In practice, one is often interested in the travel distance between two points along roads, rather than as the crow flies. In a
grid plan, the travel distance between street corners is given by the
Manhattan distance: the number of east–west and north–south blocks one must traverse to get between those two points. • Chessboard distance, formalized as
Chebyshev distance, is the minimum number of moves a
king must make on a
chessboard in order to travel between two squares. ==Metaphorical distances==