Distance Definition in Physics, Math, and Cosmology

Distance is, at its most intuitive, the amount of space between two points. That bare-bones idea is one of the oldest in human thought, yet it fractures into surprisingly different formal definitions depending on the field using it. A physicist measuring the gap between galaxies, a computer scientist comparing two strings of text, and a psychologist studying how people think about the future are all talking about “distance,” but they mean quite different things and measure them in incompatible ways. The everyday sense of the word, pulling out a tape measure and reading a number, turns out to be just one member of a large and sometimes strange family.

The Familiar Version and Its Fine Print

For most purposes, distance means the length of the shortest straight line between two locations. If you could stretch an infinitely thin thread from one point to another through empty space, the length of that thread is the distance between them. This is Euclidean distance, named after the ancient Greek mathematician whose geometry most of us learned in school. It works beautifully on flat surfaces and in ordinary three-dimensional space, and it is the version baked into GPS navigation, sports fields, and construction blueprints.

But even in daily life, Euclidean distance is often not the number you actually care about. If you need to drive from one side of a city to the other, the straight-line distance is almost useless because streets run in a grid. The practical distance you travel, following right-angle turns, is always longer than the straight-line distance. Mathematicians call this “Manhattan distance” (after the grid layout of Manhattan streets), and it follows a slightly different rule: instead of computing the hypotenuse of a triangle, you just add the horizontal and vertical legs together.

Both Euclidean and Manhattan distance belong to a broader family called Minkowski distances. They share a single underlying formula, but you plug in different values for a single parameter to get different behaviors. Setting that parameter to two gives you the familiar Euclidean distance, while setting it to one gives you Manhattan distance. Values in between produce a spectrum of intermediate distance measures. A study comparing these metrics in health-service planning found that the choice of distance measure meaningfully affects results: hospital accessibility estimates change depending on whether you use straight-line distance, Manhattan distance, or something in between, because real road networks rarely match either idealization perfectly.1BMC Health Services Research. Comparison of distance measures in spatial analytical modeling for health service planning

What Makes Something Count as a “Distance” in Mathematics

Mathematicians are precise about what qualifies as a genuine distance function, or “metric.” To earn the name, a measure has to satisfy a few rules. The distance from any point to itself must be zero. The distance from A to B must equal the distance from B to A. And the direct distance from A to C can never be longer than going from A to B and then from B to C (the so-called triangle inequality, which just formalizes the intuition that a detour is never shorter than going straight). Any function that meets these rules counts as a distance, even if it measures something that has nothing to do with physical space.

This abstraction is what allows the word “distance” to appear in fields far removed from geometry. Once you define a function that satisfies those rules for whatever objects you are comparing, you have a legitimate distance and can use all the mathematical machinery that comes with it. The objects might be points on a map, probability distributions, DNA sequences, or consumer preference profiles. The concept carries over; only the formula changes.

Distance Between Strings of Text

One of the most widely used non-spatial distances is edit distance, sometimes called Levenshtein distance. It measures how different two strings of characters are by counting the minimum number of single-character changes needed to transform one string into the other. Those changes can be insertions (adding a character), deletions (removing one), or substitutions (swapping one character for another).2arXiv. An Algorithmic Bridge Between Hamming and Levenshtein Distances If you have the word “kitten” and want to turn it into “sitting,” you can work through a sequence of substitutions and an insertion to get there; the length of the shortest such sequence is the edit distance.

A simpler cousin is Hamming distance, which only allows substitutions and requires the two strings to be the same length. Comparing “1011” to “1001,” you find one position where they differ, so the Hamming distance is one. Edit distance is more flexible but harder to compute. Research in computational complexity has shown that estimating edit distance is provably harder than estimating Hamming distance, a gap that matters when you are comparing millions of DNA sequences or running spell-checkers across entire dictionaries.3SIAM Journal on Computing. The Computational Hardness of Estimating Edit Distance

These string distances are everywhere in practice. Your phone’s autocorrect works by finding dictionary words with the smallest edit distance from whatever you typed. Bioinformatics tools align DNA sequences by finding the minimum edits that transform one into the other, which reveals evolutionary relationships. Search engines use variants of edit distance to handle typos. The concept of “how far apart” two pieces of text are is just as rigorous as spatial distance; it satisfies the same mathematical rules.

Statistical Distance Between Probability Distributions

When the objects being compared are not points or strings but entire probability distributions, you need a different kind of distance. One increasingly popular choice is the Wasserstein distance, sometimes called the “earth mover’s distance.” It measures the minimal effort required to reshape one probability distribution into another, as if you were shoveling a pile of dirt from one shape into a different shape and wanted to move as little dirt as short a distance as possible.4Annual Review of Statistics and Its Application. Statistical Aspects of Wasserstein Distances

Wasserstein distances have become central in machine learning, particularly in training generative adversarial networks (GANs), the systems behind much AI-generated imagery. They also show up in economics, ecology, and any field where you need to compare how two distributions of something differ, whether that something is income, species abundance, or pixel intensities in an image. The “distance” here has nothing to do with space. It is a measure of dissimilarity between shapes of data.

Distance at Molecular Scales

At the opposite end of the size spectrum, biophysicists need to measure distances between specific atoms on a single protein or between two molecules sitting a few nanometers apart. One of the most important tools for this is Förster resonance energy transfer, known as FRET. The technique works by attaching two fluorescent tags (a “donor” and an “acceptor”) to different parts of a molecule. When light excites the donor, it can transfer energy to the acceptor without emitting a photon, and how efficiently it does so depends steeply on the distance between the two tags. By measuring the efficiency of this energy transfer, researchers can estimate intermolecular distances, which is why FRET is often called a “spectroscopic ruler.”5PubMed Central. Theory of FRET “Spectroscopic Ruler” for Short Distances: Application to Polyproline

The ruler is not perfect. Single-molecule experiments on polyproline peptides of various lengths have shown that real FRET measurements can deviate considerably from the predictions of the standard theory, especially at very short or very long donor-acceptor separations. At distances much less than the characteristic transfer range, observed efficiencies come in lower than expected, while at longer distances they come in higher. Factors like the bending flexibility of the molecule and the physical size of the dye tags themselves contribute to the discrepancy.6PubMed Central. Polyproline and the “spectroscopic ruler” revisited with single-molecule fluorescence Despite these complications, FRET remains one of the few techniques that can report distances on the scale of individual proteins, making it indispensable for structural biology.

When Space Itself Warps the Ruler

In everyday life, the distance between two objects does not depend on how fast you or they are moving. Relativity changes this. Einstein showed that measurements of space and time are not independent: they blend together into a single four-dimensional fabric called spacetime. The “distance” between two events in spacetime, known as the spacetime interval, mixes spatial separation with temporal separation. An observer moving quickly relative to another will measure different spatial distances and different time intervals, but both will agree on the spacetime interval.7PLoS ONE. Revisiting Special Relativity: A Natural Algebraic Alternative to Minkowski Spacetime

General relativity adds another layer: mass and energy curve spacetime, so the shortest path between two points is no longer a straight line in the Euclidean sense. It is a curved path called a geodesic, analogous to the great-circle routes that airplanes fly across the curved surface of the Earth. In the geometry around a massive object like a black hole, geodesic paths can look nothing like straight lines, and the “distance” between two points depends on the distribution of mass nearby. Work on geodesic orbits in the Schwarzschild geometry (the spacetime around a non-rotating spherical mass) has shown that while the relativistic equations reduce to familiar Newtonian orbits in the slow, weak-gravity limit, the spatial geometry taken on its own can behave in ways that have no Newtonian counterpart at all.8European Journal of Physics. Space–time and spatial geodesic orbits in Schwarzschild geometry

Newton himself thought of distance as something measured against a fixed, rigid backdrop that he called “absolute space,” a kind of invisible stage on which all motion played out. That picture held for over two centuries before relativity replaced it. Modern physics treats distance as something that depends on the observer and on the geometry of spacetime itself, not as a reading off of an unchanging background grid.

Cosmological Distances and Why There Are Several of Them

Nowhere does the concept of distance become more slippery than in cosmology. The universe is expanding, which means that the space between distant galaxies is growing even as light travels through it. This creates a situation in which no single number can capture what you intuitively mean by “how far away is that galaxy.” Instead, cosmologists work with several different distance definitions, each answering a slightly different question.

Luminosity distance answers: “How far away would this object need to be in a static universe to appear as dim as it does?” Angular-diameter distance answers: “How far away would this object need to be in a static universe to look as small as it does?” Comoving distance strips out the expansion of the universe to give the separation between two objects as it would be measured at the current moment if you could freeze everything in place. And light-travel distance is simply how long the light has been traveling, multiplied by the speed of light. A comparison of these distance types in the standard cosmological model shows that they all agree at low redshifts (nearby objects) but diverge dramatically for objects at high redshift (far away, meaning we see them as they were billions of years ago).9Publications of the Astronomical Society of the Pacific. ΛCDM Cosmology for Astronomers

Angular-diameter distance, for instance, actually starts decreasing beyond a certain redshift: very distant objects can appear larger on the sky than somewhat nearer ones, the opposite of everyday experience. Luminosity distance, meanwhile, keeps climbing and can exceed the light-travel distance by a large factor. These are not competing estimates of a single “true” distance. They are genuinely different physical quantities that coincide only when the universe’s expansion is negligible.

A key relationship linking two of these is the Etherington reciprocity relation, which states that luminosity distance and angular-diameter distance are related by a factor that depends on the redshift. In an expanding universe, the luminosity distance is related to the comoving distance by a factor of one plus the redshift, and the angular-diameter distance is the comoving distance divided by that same factor.10arXiv. Empirical measurement of cosmic luminosity-angular distance relation Testing whether this relationship holds observationally is one way cosmologists check whether light propagation in the real universe follows the predictions of general relativity.

Genetic Distance and Isolation by Geography

In evolutionary biology, “distance” refers to how genetically different two populations are from each other, and one of the most consistent patterns in the field is that genetic distance increases with geographic distance. This pattern, called isolation by distance, arises because organisms that live far apart are less likely to interbreed, so their gene pools gradually drift apart over generations.

Quantifying isolation by distance involves comparing a measure of genetic differentiation between pairs of populations with the physical distance separating them. A widely used approach involves regressing a transformed version of a standard genetic differentiation statistic against geographic distance (or the logarithm of geographic distance for two-dimensional habitats).11Genetics. Genetic Differentiation and Estimation of Gene Flow from F-Statistics Under Isolation by Distance If you plot the results, a clear upward slope tells you that geography is limiting gene flow.

Real landscapes complicate things. Physical barriers like mountain ranges or rivers, and environmental differences like temperature or salinity gradients, can cause populations to diverge faster than geographic distance alone would predict. A genomic study of threespine stickleback fish attempted to tease apart these effects, measuring genetic differentiation across pairs of populations within connected lake systems and evaluating how much of the divergence could be attributed to simple spatial separation versus environmental differences and physical barriers.12Evolution. Partitioning the effects of isolation by distance, environment, and physical barriers on genomic divergence between parapatric threespine stickleback The point is that even in biology, “distance” needs careful definition: geographic distance measured in kilometers and genetic distance measured in allele-frequency divergence are two different quantities, and the relationship between them reveals how evolution works in practice.

Psychological Distance

Perhaps the most surprising extension of the distance concept comes from psychology. Construal-level theory proposes that the human mind treats time, space, social closeness, and even probability as different dimensions of a single underlying variable called psychological distance. Something happening next week, something happening far away, something happening to a stranger, and something that is merely hypothetical are all, according to this framework, “distant” in a way the brain processes similarly.13PubMed Central. Construal-level theory of psychological distance

The core finding is that as any form of psychological distance increases, people shift to more abstract, high-level thinking. When you picture what you will do tomorrow, you think about concrete details: which shoes to wear, which route to take. When you picture what you will do a year from now, you think in terms of broad goals and values. Research across many experiments has confirmed that spatial distance, temporal distance, social distance, and hypotheticality all produce this same shift, influence each other, and similarly affect decisions like what to buy, how to evaluate risks, and whom to trust.14Journal of Consumer Psychology. Construal Levels and Psychological Distance: Effects on Representation, Prediction, Evaluation, and Behavior

This is not just academic curiosity. Psychological distance affects practical decision-making in measurable ways. Marketers use it: an advertisement for an event happening next week will be more persuasive if it emphasizes concrete features (comfortable seats, free parking), while an ad for something months away works better with abstract appeals (a once-in-a-lifetime experience). Policymakers run into it when trying to motivate action on distant threats like climate change, where the psychological distance of the consequences makes people default to abstract, less urgent thinking.

When Distance Stops Mattering

Quantum mechanics introduces perhaps the most counterintuitive wrinkle of all: in certain situations, distance appears to be irrelevant. Two particles that have become entangled share correlated properties regardless of how far apart they are. Measure one, and the outcome is instantly correlated with what you would find measuring the other, whether they are separated by a millimeter or a light-year. This phenomenon, often called quantum nonlocality, means that the correlations between entangled particles are not constrained by spatial distance at all.15Theoretical and Natural Science. Quantum Entanglement and Nonlocality: Challenging the Local Realism of Classical Physics

Entanglement does not allow faster-than-light communication, because the measurement outcomes look random on each side individually; the correlation only shows up when you compare the two sets of results. But the existence of these distance-independent correlations has been confirmed in experiments stretching entangled photons across hundreds of kilometers. It suggests that whatever “distance” means in the quantum world, it does not carry the same causal weight we assume in everyday life. Two entangled particles are, in a real physical sense, not fully separable no matter how much space you put between them. That idea resists easy reconciliation with everything else in this article, which is part of what makes it one of the deepest open questions in physics.