Calculating area of shapes with semi-circular ends