Calculating area of right triangles