The shoelace formula, shoelace algorithm, or shoelace method (also known as Gauss's area formula and the surveyor's formula)
is a mathematical
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
to determine the
area
Area is the quantity that expresses the extent of a region on the plane or on a curved surface. The area of a plane region or ''plane area'' refers to the area of a shape or planar lamina, while '' surface area'' refers to the area of an ope ...
of a
simple polygon
In geometry, a simple polygon is a polygon that does not intersect itself and has no holes. That is, it is a flat shape consisting of straight, non-intersecting line segments or "sides" that are joined pairwise to form a single closed path. If ...
whose vertices are described by their
Cartesian coordinates in the plane.
It is called the shoelace formula because of the constant cross-multiplying for the coordinates making up the polygon, like threading shoelaces.
It has applications in surveying and forestry,
[Hans Pretzsch, ]
Forest Dynamics, Growth and Yield: From Measurement to Model
', Springer, 2009, , p. 232. among other areas.
The formula was described by Albrecht Ludwig Friedrich Meister (1724–1788) in 1769 and is based on the trapezoid formula which was described by
Carl Friedrich Gauss
Johann Carl Friedrich Gauss (; german: Gauß ; la, Carolus Fridericus Gauss; 30 April 177723 February 1855) was a German mathematician and physicist who made significant contributions to many fields in mathematics and science. Sometimes refer ...
and
C.G.J. Jacobi. The triangle form of the area formula can be considered to be a special case of
Green's theorem.
The area formula can also be applied to self-overlapping polygons since the meaning of area is still clear even though self-overlapping polygons are not generally
simple
Simple or SIMPLE may refer to:
*Simplicity, the state or quality of being simple
Arts and entertainment
* ''Simple'' (album), by Andy Yorke, 2008, and its title track
* "Simple" (Florida Georgia Line song), 2018
* "Simple", a song by Johnn ...
. Furthermore, a self-overlapping polygon can have multiple "interpretations" but the Shoelace formula can be used to show that the polygon's area is the same regardless of the interpretation.
The polygon area formulas
''Given:'' A planar
simple polygon
In geometry, a simple polygon is a polygon that does not intersect itself and has no holes. That is, it is a flat shape consisting of straight, non-intersecting line segments or "sides" that are joined pairwise to form a single closed path. If ...
with a ''positively oriented'' (counter clock wise) sequence of points
in a
Cartesian coordinate system.
For the simplicity of the formulas below it is convenient to set
.
''The formulas:''
The area of the given polygon can be expressed by a variety of formulas, which are connected by simple operations (see below):
If the polygon is ''negatively oriented'', then the result
of the formulas is negative. In any case
is the sought area of the polygon.
Trapezoid formula
The trapezoid formula sums up a sequence of oriented areas
of
trapezoid
A quadrilateral with at least one pair of parallel sides is called a trapezoid () in American and Canadian English. In British and other forms of English, it is called a trapezium ().
A trapezoid is necessarily a convex quadrilateral in Eu ...
s with
as one of its four edges (see below):
Triangle formula
The triangle formula sums up the oriented areas
of triangles
:
Shoelace formula
The determinant formulas are the base of the popular ''shoelace formula'', which is a scheme, that optimizes the calculation of the sum of the 2×2-Determinants by hand:
Other formulas
A particularly concise statement of the formula can be given in terms of the
exterior algebra
In mathematics, the exterior algebra, or Grassmann algebra, named after Hermann Grassmann, is an algebra that uses the exterior product or wedge product as its multiplication. In mathematics, the exterior product or wedge product of vectors is a ...
. If
are the
consecutive vertices of the polygon (regarded as vectors in
the Cartesian plane) then
Example
For the area of the pentagon with
one gets
The advantage of the shoelace form: Only 6 columns have to be written for calculating the 5 determinants with 10 columns.
Deriving the formulas
Trapezoid formula
The edge
determines the trapezoid
with its oriented area
:
In case of