Shoelace formula
Encyclopedia
The shoelace formula, or shoelace algorithm, is a mathematical algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

 to determine the area
Area
Area is a quantity that expresses the extent of a two-dimensional surface or shape in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat...

 of a polygon
Polygon
In geometry a polygon is a flat shape consisting of straight lines that are joined to form a closed chain orcircuit.A polygon is traditionally a plane figure that is bounded by a closed path, composed of a finite sequence of straight line segments...

 whose vertices are described by ordered pair
Ordered pair
In mathematics, an ordered pair is a pair of mathematical objects. In the ordered pair , the object a is called the first entry, and the object b the second entry of the pair...

s in the plane. The user cross-multiplies corresponding coordinates to find the area encompassing the polygon, and subtracts it from the surrounding polygon to find the area of the polygon within. It is called the shoelace formula because of the constant cross-multiplying for the coordinates making up the polygon, like tying shoelaces. It is also sometimes called the shoelace method. It is also known as Gauss' area formula, after Carl Friedrich Gauss
Carl Friedrich Gauss
Johann Carl Friedrich Gauss was a German mathematician and scientist who contributed significantly to many fields, including number theory, statistics, analysis, differential geometry, geodesy, geophysics, electrostatics, astronomy and optics.Sometimes referred to as the Princeps mathematicorum...

. It has applications in surveying and forestry, among other areas.

The formula can be represented by the expression:


where
  • A is the area of the polygon,
  • n is the number of sides of the polygon, and
  • (xiyi), i = 1, ,..., n are the vertices (or "corners") of the polygon.


Alternatively:


where xn+1 = x1 and yn+1 = y1.

Examples

The user must know the points of the polygon in a Cartesian plane. For example, take a triangle with coordinates {(2, 1), (4, 5), (7, 8)}. Take the first x-coordinate and multiply it by the second y-value, and repeat, and keep repeating this process. This can be defined by this formula:


for xn and yn representing each respective coordinate. Note that this works only for triangles. Using this formula, one finds that the area of the triangle equals one half of the absolute value
Absolute value
In mathematics, the absolute value |a| of a real number a is the numerical value of a without regard to its sign. So, for example, the absolute value of 3 is 3, and the absolute value of -3 is also 3...

 of 10 + 32 + 7 − 4 − 35 − 16, which equals 3. The number of sides of the polygon
Polygon
In geometry a polygon is a flat shape consisting of straight lines that are joined to form a closed chain orcircuit.A polygon is traditionally a plane figure that is bounded by a closed path, composed of a finite sequence of straight line segments...

 will alternate with the number of variables. For example, a pentagon (five sides) will be defined up to x5 and y5 points, up to


and a quadrilateral is


For complex coordinates, one must take the absolute value before dividing by 2.

More complex example

Consider the polygon defined by the points (4,3), (11,5), (8,12), (5,9), and (6,5), and illustrated in the following diagram:
The area of this polygon is:

Explanation of name

The reason this formula is called the shoelace formula is because of the method used to find it. This method uses matrices
Matrix (mathematics)
In mathematics, a matrix is a rectangular array of numbers, symbols, or expressions. The individual items in a matrix are called its elements or entries. An example of a matrix with six elements isMatrices of the same size can be added or subtracted element by element...

. As an example, choose the triangle with vertices (2,4), (3,−8), and (1,2). Then construct the following matrix by “walking around” the triangle and ending with the initial point.


First, draw diagonal down and to the right slashes (as shown below),
  

and multiply the two numbers connected by each slash, then add all the products: (2 × −8) + (3 × 2) + (1 × 4) = −6. Do the same with slashes diagonal down and to the left (shown below with former slashes):
  

(4 × 3) + (−8 × 1) + (2 × 2) = 8. Then, subtract these two numbers and take the absolute value of the difference: |−6 − 8| = 14. Halving this gives the area of the triangle: 7. Organizing the numbers like this can make the formula easier to recall and evaluate. With all the slashes drawn, the matrix loosely resembles a shoe with the laces done up, giving rise to the algorithm's name.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK