Area formulas for rectangles and triangles