how to get the midsegment of a trapezoid?