
A taxicab geometry or a Manhattan geometry is a
geometry whose usual distance function or
metric of
Euclidean geometry is replaced by a new metric in which the
distance between two points is the sum of the
absolute differences of their
Cartesian coordinates. The taxicab metric is also known as rectilinear distance, ''L''
1 distance, ''L''
1 distance or
norm (see
''Lp'' space),
snake distance, city block distance, Manhattan distance or Manhattan length. The latter names refer to the rectilinear street layout on the island of
Manhattan, where the shortest path a taxi travels between two points is the sum of the absolute values of distances that it travels on avenues and on streets.
The geometry has been used in
regression analysis since the 18th century, and is often referred to as
LASSO. The geometric interpretation dates to
non-Euclidean geometry of the 19th century and is due to
Hermann Minkowski
Hermann Minkowski (; ; 22 June 1864 – 12 January 1909) was a German mathematician and professor at Königsberg, Zürich and Göttingen. He created and developed the geometry of numbers and used geometrical methods to solve problems in number t ...
.
In
, the taxicab distance between two points
and
is
. That is, it is the sum of the absolute values of the differences in both coordinates.
Formal definition
The taxicab distance,
, between two vectors
in an ''n''-dimensional
real vector space with fixed
Cartesian coordinate system
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in t ...
, is the sum of the lengths of the projections of the
line segment
In geometry, a line segment is a part of a straight line that is bounded by two distinct end points, and contains every point on the line that is between its endpoints. The length of a line segment is given by the Euclidean distance between ...
between the points onto the
coordinate axes. More formally,
For example, in
, the taxicab distance between
and
is
History
The ''L''
1 metric was used in
regression analysis in 1757 by
Roger Joseph Boscovich.
The geometric interpretation dates to the late 19th century and the development of
non-Euclidean geometries, notably by
Hermann Minkowski
Hermann Minkowski (; ; 22 June 1864 – 12 January 1909) was a German mathematician and professor at Königsberg, Zürich and Göttingen. He created and developed the geometry of numbers and used geometrical methods to solve problems in number t ...
and his
Minkowski inequality, of which this geometry is a special case, particularly used in the
geometry of numbers, . The formalization of
''L''p spaces is credited to .
Properties
Taxicab distance depends on the
rotation
Rotation, or spin, is the circular movement of an object around a '' central axis''. A two-dimensional rotating object has only one possible central axis and can rotate in either a clockwise or counterclockwise direction. A three-dimensional ...
of the coordinate system, but does not depend on its
reflection about a coordinate axis or its
translation. Taxicab geometry satisfies all of
Hilbert's axioms (a formalization of
Euclidean geometry) except for the
side-angle-side axiom, as two triangles with equally "long" two sides and an identical angle between them are typically not
congruent unless the mentioned sides are parallel.
Balls

A
topological ball is a set of points with a fixed distance, called the ''
radius'', from a point called the ''
center''. In ''n''-dimensional Euclidean geometry, the balls are
spheres. In taxicab geometry, distance is determined by a different metric than in Euclidean geometry, and the shape of the ball changes as well. In ''n'' dimensions, a taxicab ball is in the shape of an ''n''-dimensional
orthoplex. In two dimensions, these are
squares with sides oriented at a 45° angle to the coordinate axes. The image to the right shows why this is true, by showing in red the set of all points with a fixed distance from a center, shown in blue. As the size of the city blocks diminishes, the points become more numerous and become a rotated square in a continuous taxicab geometry. While each side would have length
using a
Euclidean metric, where ''r'' is the circle's radius, its length in taxicab geometry is 2''r''. Thus, a circle's circumference is 8''r''. Thus, the value of a geometric analog to
is 4 in this geometry. The formula for the unit circle in taxicab geometry is
in
Cartesian coordinates
A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in t ...
and
in
polar coordinates.
A circle of radius 1 (using this distance) is the
von Neumann neighborhood of its center.
A circle of radius ''r'' for the
Chebyshev distance (
L∞ metric) on a plane is also a square with side length 2''r'' 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.
Arc Length
Let
be a
continuously differentiable
In mathematics, a differentiable function of one real variable is a function whose derivative exists at each point in its domain. In other words, the graph of a differentiable function has a non-vertical tangent line at each interior point in its ...
function in
. Let
be the taxicab
arc length of the planar
curve
In mathematics, a curve (also called a curved line in older texts) is an object similar to a line (geometry), line, but that does not have to be Linearity, straight.
Intuitively, a curve may be thought of as the trace left by a moving point (ge ...
defined by
on some interval
. Then the taxicab length of the
infinitesimal
regular partition of the arc,
, is given by:
By the
Mean Value Theorem
In mathematics, the mean value theorem (or Lagrange theorem) states, roughly, that for a given planar arc between two endpoints, there is at least one point at which the tangent to the arc is parallel to the secant through its endpoints. It i ...
, there exists some point
between
and
such that
.
Then
is given as the sum of every partition of
on