def bottom(x): # Triangular island with pit on right slope
H = 10.0
island_height = 20.0
island_half_width = 222
pit_offset = 120.0
pit_halfwidth = 50.0
pit_depth = 6.0
xc = (x[0] + x[-1]) / 2
distance = np.abs(x - xc)
b = np.zeros_like(x)
mask = distance <= island_half_width
b[mask] = island_height * (1 - distance[mask] / island_half_width)
pit_center = xc + pit_offset # pit on right slope
d = np.abs(x - pit_center)
pit_mask = (x > xc) & (d <= pit_halfwidth)
b[pit_mask] -= pit_depth * (1 - d[pit_mask] / pit_halfwidth)
return -(H - b)