calculate the maximum height reached by the rocket