Trapezoid and triangle tests and code.