function to calculate area of right triangle