On this page
Imagine your friend lives 3 blocks east and 4 blocks north of you, in a city where every street runs north–south or east–west. A crow flies 5 blocks. You walk 7, because you cannot cut through buildings. Taxicab geometry is the mathematics of that 7.
What is taxicab geometry?
Taxicab geometry keeps the ordinary coordinate plane but measures distance differently: the taxicab distance between (x₁, y₁) and (x₂, y₂) is |x₁ − x₂| + |y₁ − y₂| (Wikipedia, Taxicab geometry). It is also called Manhattan distance, city block distance, rectilinear distance or L1 distance, and it equals the length of a shortest path along horizontal and vertical grid lines (Wolfram MathWorld, Taxicab Metric).
Karl Menger gave it the name in a 1952 booklet, You Will Like Geometry, written for a public geometry exhibit at the Museum of Science and Industry in Chicago, though the L1 measure appears in 1910 in the work of Frigyes Riesz and Hermann Minkowski (Wikipedia).
Taxicab distance passes every test for a distance, including the triangle inequality, so it is a genuine metric; our post on what a metric space is, with four examples sets out the rules.
Why is a taxicab circle a square?
A circle is the set of points at a fixed distance r from a centre. Take the centre at the origin: the points satisfy |x| + |y| = r. In the first quadrant that is the line x + y = r, and the other three quadrants mirror it, so you get a square standing on its corner with vertices at (r, 0), (0, r), (−r, 0) and (0, −r) (Wikipedia).
Now measure that square with the taxicab ruler. One side runs from (r, 0) to (0, r), so its length is r + r = 2r. Four sides give a circumference of 8r, the diameter is 2r, and the ratio circumference ÷ diameter is 8r ÷ 2r = 4. In taxicab geometry, π equals 4 (Wikipedia).
Can the points equidistant from two points form a region?
In Euclidean geometry, the points equally far from A and B form one line, the perpendicular bisector. In taxicab geometry, try A = (0, 0) and B = (2, 2).
Inside the square 0 ≤ x ≤ 2, 0 ≤ y ≤ 2, the condition is x + y = (2 − x) + (2 − y), which gives x + y = 2: a diagonal segment from (0, 2) to (2, 0).
In the corner x ≤ 0, y ≥ 2, the distance to A is −x + y and the distance to B is (2 − x) + (y − 2) = y − x. They are equal for every point, so the whole quarter-plane qualifies.
By symmetry, the quarter-plane x ≥ 2, y ≤ 0 qualifies too.
So the "bisector" is a segment joining two infinite shaded regions. This happens whenever distinct points A and B lie on a 45° diagonal, |x₁ − x₂| = |y₁ − y₂|; otherwise the answer is a single path, often with two bends. Compare the Euclidean locus problem in our post on the circle of Apollonius, where a ratio of distances traces a clean circle.
How many shortest taxicab paths are there?
Go back to the friend 3 east and 4 north. Every shortest route is a string of 7 moves: 3 Es and 4 Ns in some order. Choosing which 3 of the 7 moves are E fixes the route, so the count is C(7, 3) = 35. In general, from (0, 0) to (m, n) on a grid there are C(m + n, m) shortest paths, all with the same taxicab length m + n.
Exam versions add a twist: a required stop (multiply the counts for the two legs) or a blocked junction (subtract the paths through it). Practise with our JEE Main permutations and combinations practice set.
Where does Manhattan distance matter?
Routing on grids. On a street grid, a warehouse floor or a circuit board with horizontal and vertical wires, L1 distance is the real travel length.
Machine learning. The Python library scikit-learn has a manhattan_distances function that computes L1 distances between data points (scikit-learn documentation).
High-dimensional data. Aggarwal, Hinneburg and Keim (2001) argued that for high-dimensional data mining the Manhattan (L1) distance gives more meaningful results than the Euclidean (L2) distance, and that fractional distances do better still (Crossref record, DOI 10.1007/3-540-44503-X_27).
Regression. Roger Joseph Boscovich used the L1 measure to judge goodness of fit in 1757, and an L1 penalty is the core of the LASSO method used today (Wikipedia).
A four-step checklist for any taxicab problem
Write each distance with absolute values, |x − a| + |y − b|.
Split the plane where each absolute value changes sign, at x = a and y = b.
Solve the linear equation in each region and join the pieces.
Check one point from each piece by computing both distances.
If absolute values, loci or nCr still feel shaky, the Fermi Concept Library explains every concept in mathematics, physics, chemistry, biology and computing. When you are stuck on a counting question, the Fermi Problem Library works problems through with a step-by-step solver that explains the reasoning.



