Shoelace Formula
Calculate polygon area from vertex coordinates using the Shoelace Formula.
Works for any simple polygon with known vertices.
The Formula
The Shoelace Formula, also known as Gauss's area formula or the surveyor's formula, computes the area of any simple polygon when you know the coordinates of its vertices. The name comes from the criss-cross pattern of multiplication that resembles lacing a shoe. You list all the vertex coordinates in order around the polygon, then multiply each x-coordinate by the next y-coordinate and subtract the reverse product. Sum all those differences, take the absolute value, and divide by two. The result is the exact area of the polygon.
This formula is remarkably powerful because it works for any simple (non-self-intersecting) polygon, whether it has three sides or three hundred. It does not require you to know side lengths, angles, or heights. All you need are the (x, y) coordinates of each vertex listed in consecutive order, either clockwise or counterclockwise. The absolute value ensures you get a positive area regardless of the direction you traverse the vertices.
The Shoelace Formula is widely used in computational geometry, geographic information systems (GIS), computer graphics, and land surveying. Surveyors use it to compute land parcel areas from GPS coordinates. Game developers use it to determine the area of irregular shapes drawn on screen. It is also a foundational tool in algorithms that detect polygon intersections and perform spatial analysis.
Variables
| Symbol | Meaning |
|---|---|
| A | Area of the polygon |
| n | Number of vertices |
| xi, yi | Coordinates of the i-th vertex |
| xi+1, yi+1 | Coordinates of the next vertex (wrapping to vertex 0 after the last) |
Example 1
Find the area of a triangle with vertices (1, 1), (4, 1), (4, 5).
Cross products: (1×1 − 4×1) + (4×5 − 4×1) + (4×1 − 1×5)
= (1 − 4) + (20 − 4) + (4 − 5) = −3 + 16 − 1 = 12
A = ½ |12| = 6 square units
Example 2
Find the area of a quadrilateral with vertices (0, 0), (4, 0), (4, 3), (0, 3).
Cross products: (0×0 − 4×0) + (4×3 − 4×0) + (4×3 − 0×3) + (0×0 − 0×3)
= 0 + 12 + 12 + 0 = 24
A = ½ |24| = 12 square units (a 4 × 3 rectangle, as expected)
When to Use It
The Shoelace Formula is ideal whenever you have vertex coordinates and need a polygon's area.
- Surveying land parcels from GPS or map coordinates
- Computing areas in computer graphics and game development
- GIS applications for calculating geographic region sizes
- Robotics path planning where enclosed area matters
- Any math or engineering problem where a polygon is defined by its corner points