Taxicab geometry

Taxicab geometry or Manhattan geometry is geometry where the familiar Euclidean distance is ignored, and the distance between two points is instead defined to be the sum of the absolute differences of their respective Cartesian…

Uses your system voice; voice and rate in settings.

≈ 6 min read

Cite, export and learn8 citation formats · 8 exports · lesson and quiz

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Taxicab geometry or Manhattan geometry is geometry where the familiar Euclidean distance is ignored, and the distance between two points is instead defined to be the sum of the absolute differences of their respective Cartesian coordinates, a distance function (or metric) called the taxicab distance, Manhattan distance, or city block distance. The name refers to the island of Manhattan, or generically any planned city with a rectangular grid of streets, in which a taxicab can only travel along grid directions.

In taxicab geometry, the distance between any two points equals the length of their shortest grid path. This different definition of distance also leads to a different definition of the length of a curve, for which a line segment between any two points has the same length as a grid path between those points rather than its Euclidean length.

The taxicab distance is also sometimes known as rectilinear distance or distance (see L p space). This geometry has been used in regression analysis since the 18th century, and is often referred to as LASSO. Its geometric interpretation dates to non-Euclidean geometry of the 19th century and is due to Hermann Minkowski.

In the two-dimensional real coordinate space \R^2 , the taxicab distance between two points (x_1, y_1) and (x_2, y_2) is \left|x_1 - x_2\right| + \left|y_1 - y_2\right| . That is, it is the sum of the absolute values of the differences in both coordinates.

The taxicab distance, d_\text{T} , between two points \mathbf{p} = (p_1, p_2, \dots, p_n) and \mathbf{q} = (q_1, q_2, \dots, q_n) in an n-dimensional real coordinate space with fixed Cartesian coordinate system, is the sum of the lengths of the projections of the line segment between the points onto the coordinate axes. More formally, d_\text{T}(\mathbf{p}, \mathbf{q}) = \left\|\mathbf{p} - \mathbf{q}\right\|_\text{T} = \sum_{i=1}^n \left|p_i - q_i\right| For example, in \mathbb{R}^2 , the taxicab distance between \mathbf{p} = (p_1,p_2) and \mathbf{q} = (q_1,q_2) is \left| p_1 - q_1 \right| + \left| p_2 - q_2 \right|. d_\text{T}(\mathbf p, \mathbf c) = \sum_{i=1}^n \left|p_i - c_i\right| = r, where \mathbf{c} is the center and r is the radius.

Points \mathbf{p} on the unit sphere, a sphere of radius 1 centered at the origin, satisfy the equation d_\text{T}(\mathbf p, \mathbf 0) = \sum_{i=1}^n |p_i| = 1. In two dimensional taxicab geometry, the sphere (called a circle) is a square oriented diagonally to the coordinate axes.

The image to the right shows in red the set of all points on a square grid with a fixed distance from the blue center. As the grid is made finer, the red points become more numerous, and in the limit tend to a continuous tilted square. Each side has taxicab length 2r, so the circumference is 8r.

Thus, in taxicab geometry, the value of the analog of the circle constant π, the ratio of circumference to diameter, is equal to 4. A closed ball (or closed disk in the 2-dimensional case) is a filled-in sphere, the set of points at distance less than or equal to the radius from a specific center.

For cellular automata on a square grid, a taxicab disk is the von Neumann neighborhood of range r of its center. A circle of radius r for the Chebyshev distance (L ∞ metric) on a plane is also a square with side length 2r parallel to the coordinate axes, so planar Chebyshev distance can be viewed as equivalent by rotation and scaling to planar taxicab distance.

However, this equivalence between L 1 and L ∞ metrics does not generalize to higher dimensions. Whenever each pair in a collection of these circles has a nonempty intersection, there exists an intersection point for the whole collection; therefore, the Manhattan distance forms an injective metric space. Let y = f(x) be a continuously differentiable function.

Let s be the taxicab arc length of the graph of f on some interval [a,b] . Take a partition of the interval into equal infinitesimal subintervals, and let \Delta s_i be the taxicab length of the i -th subarc. Then \Delta s_i = \Delta x_i + \Delta y_i = \Delta x_i+ |f(x_i) - f(x_{i-1})|.

By the mean value theorem, there exists some point x^*_i between x_i and x_{i-1} such that f(x_i) - f(x_{i-1}) = f'(x^*_i) \Delta x_i . Then the previous equation can be written \Delta s_i = \Delta x_i + |f'(x^*_i)| \, \Delta x_i = \Delta x_i(1+|f'(x^*_i)|).

Then s is given as the sum of every partition of s on [a,b] as they get arbitrarily small: \begin{align} s &= \lim_{n \to \infty} \sum_{i=1}^n \Delta x_i(1+|f'(x^*_i)|) \\ & = \int_a^b 1+|f'(x)| \,dx. \end{align} To test this, take the taxicab circle of radius r centered at the origin. Its curve in the first quadrant is given by f(x)=-x+r whose length is s = \int_0^r 1+\left|-1\right| \, dx = 2r .

Multiplying this value by 4 to account for the remaining quadrants gives 8r , which agrees with the circumference of a taxicab circle. Now take the Euclidean circle of radius r centered at the origin, which is given by f(x) = \sqrt{r^2-x^2} .

Its arc length in the first quadrant is given by \begin{align} s &= \int_0^r 1 + \left|\frac{-x}{\sqrt{r^2 - x^2}}\right| \, dx\\[6pt] &= \left. x + \sqrt{r^2-x^2} \vphantom{\frac11} \right|_0^r \\[6pt] &= r-(-r)\\[6pt] &= 2r \end{align} Accounting for the remaining quadrants gives 4 \times 2r = 8r again. Therefore, the circumference of the taxicab circle and the Euclidean circle in the taxicab metric are equal.

In fact, for any function f that is monotonic and differentiable with a continuous derivative over an interval [a,b] , the arc length of f over [a, b] is (b-a) + \left| f(b)-f(a) \right| .

Taxicab metric with stoplights Building a Bus Stop in Taxicab Geometry, interactive, dynamic sketch

Text derived from https://en.wikipedia.org/w/index.php?oldid=1360794207 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot enwiki-001360794207 · captured 2026-06-23 · ledger · version history

Cite this page as: encyclopegia.org, “Taxicab geometry”, snapshot enwiki-001360794207. https://encyclopegia.org/a/taxicab-geometry

Sources cited in this revision

7 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.