Area calculations for rectangles and triangles