Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 37 · Area and Perimeter

Composite Shapes, Heron's Formula and Polygons

Find the area of composite shapes by adding and subtracting pieces, use Heron's formula when you only know the sides, and apply the shoelace formula to polygons.

Real shapes are rarely a single textbook figure. A floor plan has an L shape, a window may be a rectangle with a half-circle on top, and a field might have five uneven sides. In this lesson you learn three tools for these cases: splitting a shape into pieces, Heron's formula for triangles known by their sides, and the shoelace formula for polygons drawn on coordinates.

Composite shapes: add and subtract

A composite shape is made from simpler shapes. There are two main strategies:

  • Add: split the shape into rectangles, triangles, sectors and so on, then add their areas.
  • Subtract: find a big simple shape that contains your shape, then subtract the holes or missing corners.

Example 1: an L-shaped room

An L-shaped floor is 10 m wide and 8 m tall, with a 4 m by 3 m corner missing. Subtracting is quick: 10 × 8 - 4 × 3 = 80 - 12 = 68 m². Adding also works: split it into a 10 × 5 rectangle and a 6 × 3 rectangle, giving 50 + 18 = 68 m². Two methods, same answer, a good check.

Example 2: a Norman window

A window is a rectangle 1.2 m wide and 1.5 m tall with a semicircle on top, whose diameter is the 1.2 m width. The semicircle has radius 0.6 m.

  • Rectangle: 1.2 × 1.5 = 1.8 m².
  • Semicircle: ½ × π × 0.6² = 0.18π ≈ 0.565 m².
  • Total area: about 2.365 m².

The perimeter of this window is not the sum of every edge you can see: the rectangle's top edge is inside the shape where the semicircle sits on it, so leave it out. Perimeter = 1.5 + 1.5 + 1.2 + (π × 0.6) ≈ 6.08 m, where π × 0.6 is the length of the semicircular arc (half of 2π × 0.6).

Before you compute a perimeter of a composite shape, trace the outer boundary with a pencil. Only the edges you trace count.

Heron's formula

Sometimes you know all three sides of a triangle but no height and no angle. Let the sides be a, b, c. Define the semi-perimeter s = (a + b + c) / 2. Then

Text
Area = √( s (s - a)(s - b)(s - c) )

This is Heron's formula, named after Hero of Alexandria. Example: a triangle with sides 13, 14 and 15. The semi-perimeter is s = 21. Then Area = √(21 × 8 × 7 × 6) = √7056 = 84. So the area is exactly 84 square units.

You can use it only when the three lengths really form a triangle, that is, when each side is shorter than the sum of the other two. If s - a (or s - b, s - c) is zero or negative, no triangle exists.

The shoelace formula for polygons

Suppose a field's corners are given as coordinates, listed in order around the boundary: (x1, y1), (x2, y2), …, (xn, yn). The shoelace formula gives the area:

Text
Area = ½ | (x1 y2 + x2 y3 + … + xn y1) - (y1 x2 + y2 x3 + … + yn x1) |

The name comes from the criss-cross pattern of the products when you write the coordinates in two columns. Example: the quadrilateral (0,0), (4,0), (5,3), (1,4).

  • First sum: 0×0 + 4×3 + 5×4 + 1×0 = 0 + 12 + 20 + 0 = 32.
  • Second sum: 0×4 + 0×5 + 3×1 + 4×0 = 0 + 0 + 3 + 0 = 3.
  • Area = ½ |32 - 3| = 14.5.

The formula works for any simple polygon (one whose sides do not cross), as long as you list the vertices in order, clockwise or counter-clockwise.

Verify with code

The first program checks the window and the L-shape. The second tests Heron against the shoelace formula for the 13-14-15 triangle, using coordinates (0,0), (14,0), (5,12) (side lengths 14, 13 and 15).

Python Composite areas: L-shape and window

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Heron's formula versus the shoelace formula

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

All three results agree on 84 for the triangle, which confirms the formulas and the coordinates.

Strategy summary

You have Use
A shape made of simple pieces Split, add and subtract
Three sides only Heron's formula
Coordinates of the corners Shoelace formula
Two sides and the included angle ½ ab sin C

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. A triangle has sides 5, 12 and 13. Using Heron's formula, what is its area?

    s = 15, so the area is √(15 × 10 × 3 × 2) = √900 = 30. It is a right triangle: ½ × 5 × 12 = 30.
  2. 2. A rectangle 9 m by 6 m has a circular hole of radius 1 m cut from it. Which expression gives the remaining area?

    The hole has area π × 1² = π, so the remainder is 54 - π m².
  3. 3. Can sides 4, 5 and 10 form a triangle?

    Each side must be shorter than the sum of the other two. Here 4 + 5 = 9 < 10, so no triangle exists.
  4. 4. What is the shoelace area of the points (0,0), (6,0), (6,4), (0,4)?

    It is a 6 by 4 rectangle: area 24. Shoelace gives ½|(0 + 24 + 24 + 0) - (0 + 0 + 0 + 0)| = 24.

Summary

  • Composite areas come from adding pieces or subtracting holes; check by using both when possible.
  • Perimeter of a composite shape includes only the outer boundary.
  • Heron: s = (a + b + c)/2 and Area = √(s(s - a)(s - b)(s - c)).
  • Shoelace formula: ½ |Σ (xi y(i+1) - x(i+1) yi)| for vertices listed in order.

Next: Prisms and Cylinders: Volume and Surface Area