double height = 0; double area = 0; height = Math.sqrt(Math.pow(side, 2) - Math.pow((bottom - top) / 2, 2)); area = ((top + bottom) / 2) * height;