How is the area formula for a trapezoid derived?