Sub topic 9
Areas of Triangles and Polygons from Coordinates
Prerequisites and the main idea
Assume you can work with fractions, signed numbers, and basic triangle area. You should also know how to read ordered pairs on the Cartesian plane.
Coordinate geometry lets you find an area without drawing the figure accurately. For a triangle, use a base and perpendicular height when these are easy to identify. For a general polygon, use the shoelace formula.
Triangle area from coordinates
For vertices (x₁, y₁), (x₂, y₂), and (x₃, y₃), the area is
Area = 1/2 |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)|
The absolute value is necessary because the order in which the vertices are listed can make the expression positive or negative.
For the triangle with vertices (0, 0), (4, 0), and (0, 3), the horizontal side has length 4 and the vertical height is 3:
Area = 1/2 × 4 × 3 = 6
The coordinate formula gives the same result:
Area = 1/2 |0(0 − 3) + 4(3 − 0) + 0(0 − 0)| = 6
The shoelace formula
The shoelace formula works for any simple polygon whose vertices are listed consecutively around its boundary. A simple polygon does not cross itself.
For vertices (x₁, y₁), (x₂, y₂), ..., (xₙ, yₙ), repeat the first vertex after the last one. Then calculate
Area = 1/2 |(x₁y₂ + x₂y₃ + ... + xₙy₁) − (y₁x₂ + y₂x₃ + ... + yₙx₁)|
The name comes from the diagonal pattern formed by the two products.
Worked quadrilateral example
Consider the vertices (1, 1), (5, 1), (6, 4), and (2, 5), listed around the boundary.
| Forward products | Reverse products |
|---|---|
| `1×1 + 5×4 + 6×5 + 2×1 = 53` | `1×5 + 1×6 + 4×2 + 5×1 = 24` |
Therefore,
Area = 1/2 |53 − 24| = 14.5 square units
You can split the quadrilateral into triangles instead, but the shoelace method is usually faster when all coordinates are given.
def polygon_area(points):
total = 0
for i in range(len(points)):
x1, y1 = points[i]
x2, y2 = points[(i + 1) % len(points)]
total += x1 * y2 - y1 * x2
return abs(total) / 2
print(polygon_area([(1, 1), (5, 1), (6, 4), (2, 5)]))Common errors and CAT shortcuts
- Do not sort vertices by their x-coordinate unless that also preserves the boundary order.
- Close the calculation by pairing the last vertex with the first.
- Use absolute value at the end.
- If two points share a y-coordinate, use the horizontal distance as a possible base.
- If two points share an x-coordinate, use the vertical distance as a possible base.
- If the shoelace result is zero, the points are collinear, meaning they lie on one straight line.
Exercise
Find the area of the triangle with vertices (2, 1), (6, 1), and (3, 5).
Show answer
The base is 4 and the perpendicular height is 4, so the area is 1/2 × 4 × 4 = 8 square units.