Area of a Trapezoid

Calculates the area of a trapezoid as (upper base + lower base) × height ÷ 2.

A trapezoid is a quadrilateral with one pair of parallel sides. Those two parallel sides are the bases, and the perpendicular distance between them is the height. The area turns out to be the average of the bases times the height.

S=(a+b)h2S = \dfrac{(a + b) h}{2}

Example

With the defaults, an upper base of a=3a = 3, a lower base of b=5b = 5 and a height of h=4h = 4:

S=(3+5)×42=322=16S = \dfrac{(3 + 5) \times 4}{2} = \dfrac{32}{2} = 16

The area is 16.

Where the formula comes from

Take a second copy of the trapezoid, rotate it 180 degrees and join it to the first. The result is a parallelogram with base a+ba + b and height hh, so its area is (a+b)h(a + b) h, and the trapezoid is half of that. Reading the formula as a+b2×h\dfrac{a + b}{2} \times h makes the idea plain: it is the average length of the two bases, times the height.

Watch out

The bases are the parallel sides; it makes no difference which one is longer, and swapping them changes nothing, since they are added. The height is the perpendicular gap between the parallel sides, not the length of a slanted leg. Using a leg where the height belongs overestimates the area.