Shoelace formula
From Wikipedia, the free encyclopedia
The Shoelace Formula, or Shoelace algorithm, is a mathematical algorithm to determine the area of a polygon whose vertices are described by order pairs in the plane[1]. 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[2]. It is also sometimes called the Shoelace Method.
[edit] 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 to the difference of the second and third Y values, and keep repeating this process. This can be defined by this formula: |x1(y2-y3)+x2(y3-y1)+x3(y1-y2)|/2, for xn and yn representing each respective coordinate. Note that this works only for triangles. The number of sides of the polygon will alternate with the number of variables. For example, a pentagon (five sides) will be defined up to x5 and y5 points, up to |x1(y2-y3)+x2(y3-y4)+x3(y4-y5)+x4(y5-y1)+x5(y1y2)|/2. One must take the absolute value of the answer before dividing by two. The reason why one why must divide by two is because the formula basically finds the areas of triangles surrounding the polygon, and subtracts it from the circumscribed square. The area of a triangle is one half of the product of base and height.

