Solving the sea level equation, part I, theory