TExcelTAD
Home › Coordinate Geometry: 2D & 3D Cartesian Systems › Area of Triangles and Polygons via the Shoelace Formula (Gauss's Area Formula)

Area of Triangles and Polygons via the Shoelace Formula (Gauss's Area Formula)

Calculating the area of an irregular triangle or multi-sided polygon on grid paper using classical geometric formulas (Area=12bh\text{Area} = \frac{1}{2} b h) requires finding altitudes and perpendicular dropped lines, which is often tedious and error-prone.

The Shoelace Formula (also known as Gauss's Area Formula or the Surveyor's Formula) provides a clean, algebraic method to compute the exact area of any non-self-intersecting polygon directly from the coordinates of its vertices.


1. Area of a Triangle in R2\mathbb{R}^2

For a triangle with vertices A(x1,y1)A(x_1, y_1), B(x2,y2)B(x_2, y_2), and C(x3,y3)C(x_3, y_3), the area is given by the determinant of a 3×33 \times 3 coordinate matrix:

Area=12∣det⁡(x1y11x2y21x3y31)∣\text{Area} = \frac{1}{2} \left| \det \begin{pmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{pmatrix} \right|

Expanding this determinant along the third column yields the standard expanded formula:

Area=12∣x1(y2−y3)+x2(y3−y1)+x3(y1−y2)∣\text{Area} = \frac{1}{2} \Big| x_1(y_2 - y_3) + x_2(y_3 - y_1) + x_3(y_1 - y_2) \Big|

Collinearity Test: If the computed area of △ABC\triangle ABC equals 00, the three points enclose zero space and are strictly collinear.


2. The General Shoelace Formula for an nn-gon

Suppose a polygon has nn vertices ordered sequentially around its perimeter:

(x1,y1),  (x2,y2),  (x3,y3),  …,  (xn,yn)(x_1, y_1), \; (x_2, y_2), \; (x_3, y_3), \; \dots, \; (x_n, y_n)
x y P_1(x_1, y_1) P_2(x_2, y_2) P_3(x_3, y_3) P_4(x_4, y_4) Area (CCW)

The total area enclosed by the boundary is:

Area=12∣(x1y2+x2y3+⋯+xny1)−(y1x2+y2x3+⋯+ynx1)∣\text{Area} = \frac{1}{2} \Big| (x_1 y_2 + x_2 y_3 + \dots + x_n y_1) - (y_1 x_2 + y_2 x_3 + \dots + y_n x_1) \Big|

In compact summation notation:

Area=12∣∑i=1n(xiyi+1−xi+1yi)∣,where (xn+1,yn+1)=(x1,y1)\text{Area} = \frac{1}{2} \left| \sum_{i=1}^{n} (x_i y_{i+1} - x_{i+1} y_i) \right|, \quad \text{where } (x_{n+1}, y_{n+1}) = (x_1, y_1)

3. The Paper "Shoelace" Column Layout

The name Shoelace Formula comes from the criss-cross pattern formed when coordinates are listed vertically on paper.

To calculate the area on paper:

  1. Write the coordinates in two columns (xx on the left, yy on the right).
  2. List vertices in sequential order around the polygon (counterclockwise is standard).
  3. Repeat the first vertex at the bottom to close the polygon loop.
  4. Multiply downward diagonals from top-left to bottom-right (↘\searrow) and sum them: DdownD_{\text{down}}.
  5. Multiply upward diagonals from bottom-left to top-right (↗\nearrow) and sum them: DupD_{\text{up}}.
  6. The area is half the absolute difference: Area=12∣Ddown−Dup∣\text{Area} = \frac{1}{2} |D_{\text{down}} - D_{\text{up}}|.
x1y1↘↗x2y2↘↗x3y3↘↗⋮⋮xnyn↘↗x1y1Ddown=x1y2+x2y3+⋯+xny1Dup=y1x2+y2x3+⋯+ynx1Area=12∣Ddown−Dup∣\begin{matrix} x_1 & & y_1 \\ & \searrow \nearrow & \\ x_2 & & y_2 \\ & \searrow \nearrow & \\ x_3 & & y_3 \\ & \searrow \nearrow & \\ \vdots & & \vdots \\ x_n & & y_n \\ & \searrow \nearrow & \\ x_1 & & y_1 \end{matrix} \qquad \begin{aligned} D_{\text{down}} &= x_1 y_2 + x_2 y_3 + \dots + x_n y_1 \\ D_{\text{up}} &= y_1 x_2 + y_2 x_3 + \dots + y_n x_1 \\ \text{Area} &= \frac{1}{2} |D_{\text{down}} - D_{\text{up}}| \end{aligned}

4. Step-by-Step Paper Notebook Method

Step 1:Sketch the points roughly to establish sequential perimeter order (e.g. counterclockwise).Step 2:Construct the 2-column table: list x on the left, y on the right.Step 3:Repeat the initial point (x1,y1) at the very bottom of the table.Step 4:Compute Ddown by multiplying each xi by the next yi+1 and summing.Step 5:Compute Dup by multiplying each yi by the next xi+1 and summing.Step 6:Subtract: Δ=Ddown−Dup. Take the absolute value and divide by 2.\begin{aligned} \text{\bf Step 1:} &\quad \text{Sketch the points roughly to establish sequential perimeter order (e.g. counterclockwise).} \\ \text{\bf Step 2:} &\quad \text{Construct the 2-column table: list } x \text{ on the left, } y \text{ on the right.} \\ \text{\bf Step 3:} &\quad \text{Repeat the initial point } (x_1, y_1) \text{ at the very bottom of the table.} \\ \text{\bf Step 4:} &\quad \text{Compute } D_{\text{down}} \text{ by multiplying each } x_i \text{ by the next } y_{i+1} \text{ and summing.} \\ \text{\bf Step 5:} &\quad \text{Compute } D_{\text{up}} \text{ by multiplying each } y_i \text{ by the next } x_{i+1} \text{ and summing.} \\ \text{\bf Step 6:} &\quad \text{Subtract: } \Delta = D_{\text{down}} - D_{\text{up}}. \text{ Take the absolute value and divide by } 2. \end{aligned}

5. Comprehensive Worked Examples

Example 1: Area of a Triangle on Paper

Problem Statement: Find the area of △ABC\triangle ABC with vertices A(1,2)A(1, 2), B(6,3)B(6, 3), and C(3,7)C(3, 7).

Step-by-Step Solution:

  • Step 1: Write the coordinates vertically and repeat the first point

    12633712\begin{matrix} 1 & & 2 \\ 6 & & 3 \\ 3 & & 7 \\ 1 & & 2 \end{matrix}
  • Step 2: Calculate downward diagonal products (↘\searrow)

    Ddown=(1×3)+(6×7)+(3×2)=3+42+6=51\begin{aligned} D_{\text{down}} &= (1 \times 3) + (6 \times 7) + (3 \times 2) \\ &= 3 + 42 + 6 = 51 \end{aligned}
  • Step 3: Calculate upward diagonal products (↗\nearrow)

    Dup=(2×6)+(3×3)+(7×1)=12+9+7=28\begin{aligned} D_{\text{up}} &= (2 \times 6) + (3 \times 3) + (7 \times 1) \\ &= 12 + 9 + 7 = 28 \end{aligned}
  • Step 4: Compute the area

    Area=12∣Ddown−Dup∣=12∣51−28∣=12(23)=11.5 sq units\text{Area} = \frac{1}{2} |D_{\text{down}} - D_{\text{up}}| = \frac{1}{2} |51 - 28| = \frac{1}{2} (23) = 11.5\text{ sq units}

The area of triangle ABCABC is 11.5 square units11.5\text{ square units} (or 232 sq units\frac{23}{2}\text{ sq units}).


Example 2: Area of a Convex Quadrilateral

Problem Statement: Calculate the area of the quadrilateral with vertices listed in order:

P1(−3,2),P2(1,−4),P3(5,−1),P4(2,6)P_1(-3, 2), \quad P_2(1, -4), \quad P_3(5, -1), \quad P_4(2, 6)

Step-by-Step Solution:

  • Step 1: Set up the Shoelace column array

    −321−45−126−32\begin{matrix} -3 & & 2 \\ 1 & & -4 \\ 5 & & -1 \\ 2 & & 6 \\ -3 & & 2 \end{matrix}
  • Step 2: Compute DdownD_{\text{down}}

    Ddown=(−3)(−4)+(1)(−1)+(5)(6)+(2)(2)=12−1+30+4=45\begin{aligned} D_{\text{down}} &= (-3)(-4) + (1)(-1) + (5)(6) + (2)(2) \\ &= 12 - 1 + 30 + 4 = 45 \end{aligned}
  • Step 3: Compute DupD_{\text{up}}

    Dup=(2)(1)+(−4)(5)+(−1)(2)+(6)(−3)=2−20−2−18=−38\begin{aligned} D_{\text{up}} &= (2)(1) + (-4)(5) + (-1)(2) + (6)(-3) \\ &= 2 - 20 - 2 - 18 = -38 \end{aligned}
  • Step 4: Compute the area

    Area=12∣Ddown−Dup∣=12∣45−(−38)∣=12∣45+38∣=12(83)=41.5 sq units\begin{aligned} \text{Area} &= \frac{1}{2} |D_{\text{down}} - D_{\text{up}}| \\ &= \frac{1}{2} |45 - (-38)| \\ &= \frac{1}{2} |45 + 38| = \frac{1}{2}(83) = 41.5\text{ sq units} \end{aligned}

The quadrilateral has an area of 41.5 square units41.5\text{ square units}.


Example 3: Collinearity Check via Zero Area

Problem Statement: Determine whether the points K(−2,−5)K(-2, -5), L(1,1)L(1, 1), and M(4,7)M(4, 7) are collinear using the coordinate area method.

Step-by-Step Solution:

  • Step 1: Set up Shoelace columns

    −2−51147−2−5\begin{matrix} -2 & & -5 \\ 1 & & 1 \\ 4 & & 7 \\ -2 & & -5 \end{matrix}
  • Step 2: Evaluate products

    Ddown=(−2)(1)+(1)(7)+(4)(−5)=−2+7−20=−15Dup=(−5)(1)+(1)(4)+(7)(−2)=−5+4−14=−15\begin{aligned} D_{\text{down}} &= (-2)(1) + (1)(7) + (4)(-5) = -2 + 7 - 20 = -15 \\ D_{\text{up}} &= (-5)(1) + (1)(4) + (7)(-2) = -5 + 4 - 14 = -15 \end{aligned}
  • Step 3: Compute area

    Area=12∣−15−(−15)∣=12∣0∣=0\text{Area} = \frac{1}{2} |-15 - (-15)| = \frac{1}{2} |0| = 0

Since the enclosed area is identically zero, the three points enclose no polygon and are collinear.


6. Common Mistakes & Paper Traps

  1. Forgetting to Close the Loop: Stopping at the last vertex PnP_n without repeating P1P_1 at the bottom. This leaves off the final edge connecting (xn,yn)(x_n, y_n) back to (x1,y1)(x_1, y_1)!
  2. Scrambling Vertex Order: Listing vertices in arbitrary order (e.g., across diagonals) rather than sequentially around the perimeter. Scrambled order yields a self-intersecting polygon and an incorrect area.
  3. Double Negative Trap in Subtraction: In Ddown−DupD_{\text{down}} - D_{\text{up}}, if Dup=−38D_{\text{up}} = -38, write 45−(−38)=45+38=8345 - (-38) = 45 + 38 = 83.
  4. Missing the Factor of 12\frac{1}{2}: Calculating ∣Ddown−Dup∣|D_{\text{down}} - D_{\text{up}}| and forgetting to divide by 22 at the end.

7. Pencil & Paper Practice

  1. Problem 1: Find the area of the triangle with vertices O(0,0)O(0, 0), A(4,0)A(4, 0), and B(0,6)B(0, 6).
  2. Problem 2: Find the area of the pentagon with vertices in order: (0,0)(0, 0), (4,1)(4, 1), (5,4)(5, 4), (2,5)(2, 5), and (−1,3)(-1, 3).
  3. Problem 3: For what value of kk does the triangle with vertices A(1,2)A(1, 2), B(3,8)B(3, 8), and C(k,20)C(k, 20) have an area of 00?

Worked Solutions

  • Solution 1: Set up the triangle Shoelace:

    00400600\begin{matrix} 0 & & 0 \\ 4 & & 0 \\ 0 & & 6 \\ 0 & & 0 \end{matrix}
    Ddown=(0)(0)+(4)(6)+(0)(0)=24D_{\text{down}} = (0)(0) + (4)(6) + (0)(0) = 24
    Dup=(0)(4)+(0)(0)+(6)(0)=0D_{\text{up}} = (0)(4) + (0)(0) + (6)(0) = 0
    Area=12∣24−0∣=12 sq units\text{Area} = \frac{1}{2} |24 - 0| = 12\text{ sq units}

    (Matches the elementary right triangle formula: 12×4×6=12\frac{1}{2} \times 4 \times 6 = 12.)

  • Solution 2: Set up the pentagon Shoelace array:

    00415425−1300\begin{matrix} 0 & & 0 \\ 4 & & 1 \\ 5 & & 4 \\ 2 & & 5 \\ -1 & & 3 \\ 0 & & 0 \end{matrix}
    Ddown=(0)(1)+(4)(4)+(5)(5)+(2)(3)+(−1)(0)=0+16+25+6+0=47\begin{aligned} D_{\text{down}} &= (0)(1) + (4)(4) + (5)(5) + (2)(3) + (-1)(0) \\ &= 0 + 16 + 25 + 6 + 0 = 47 \end{aligned}
    Dup=(0)(4)+(1)(5)+(4)(2)+(5)(−1)+(3)(0)=0+5+8−5+0=8\begin{aligned} D_{\text{up}} &= (0)(4) + (1)(5) + (4)(2) + (5)(-1) + (3)(0) \\ &= 0 + 5 + 8 - 5 + 0 = 8 \end{aligned}
    Area=12∣47−8∣=12(39)=19.5 sq units\text{Area} = \frac{1}{2} |47 - 8| = \frac{1}{2}(39) = 19.5\text{ sq units}
  • Solution 3: An area of zero means the points are collinear:

    slope(AB)=8−23−1=62=3\text{slope}(AB) = \frac{8 - 2}{3 - 1} = \frac{6}{2} = 3
    slope(AC)=20−2k−1=18k−1\text{slope}(AC) = \frac{20 - 2}{k - 1} = \frac{18}{k - 1}

    Setting slopes equal:

    3=18k−1  ⟹  3(k−1)=18  ⟹  k−1=6  ⟹  k=73 = \frac{18}{k - 1} \implies 3(k - 1) = 18 \implies k - 1 = 6 \implies k = 7

    (Or via determinant: 12∣1(8−20)+3(20−2)+k(2−8)∣=12∣−12+54−6k∣=0  ⟹  42−6k=0  ⟹  k=7\frac{1}{2} |1(8 - 20) + 3(20 - 2) + k(2 - 8)| = \frac{1}{2} |-12 + 54 - 6k| = 0 \implies 42 - 6k = 0 \implies k = 7.)


Test yourself

What is the area of a triangle with vertices at (0,0)(0, 0), (5,0)(5, 0), and (0,4)(0, 4)?

  1. 20 sq units
  2. 10 sq units
  3. 9 sq units
  4. 5 sq units

Why must the first vertex be written again at the bottom of the column in the Shoelace formula?

  1. To normalize the coordinates to the origin
  2. To complete the closed boundary between the final vertex and the initial vertex
  3. To double the area so dividing by 2 makes sense
  4. To make the number of rows even

If the Shoelace formula calculation for three points gives Area=0\text{Area} = 0, what does this indicate geometrically?

  1. The points form an equilateral triangle
  2. The points lie on the axes
  3. The points are collinear
  4. The coordinates were entered in reverse order