Brachistochrone problem with floor restriction An object starts sliding (without friction, under the influence of gravity) from $(0, h)$ along some curve $\gamma(t) = (x(t),\space y(t))$ and just like in the usual Brachistochrone problem it must reach the point $(d, 0)$ in the shortest possible time. But we add the constraint that the curve cannot go through the floor $(y=0)$, i.e $y(t) \geq 0$.
What (if it exists) is the solution curve for this problem?

 A: The answer depends upon the distance $d$.
First, recall that the brachistochrone is a cycloid, the curve traced by a point on a circle rolling along the directrix (dashed line, figures below), which is at the height of zero kinetic energy of the particle.  Thus if the particle starts at rest (as it does in this problem), the directrix is at the height of $A$ above the "floor," denoted $h$.  The radius of the circle depends upon the locations of the initial and final points.  
If $d$ is small ($d < \pi h/2$... half the circumference of a circle that remains above the "floor"), then a single cycloid (brachistochrone) can go from $A$ to $B$ without needing to go through the floor and hence (as the Bernoulli brothers proved) is the optimal solution.

If $d$ is so large that a cycloid would have to pass "beneath the floor" (as the poser posits, i.e., $d>\pi h/2$), the solution is to take the cycloid that is tangent  to the farthest possible point on the floor (the point at $(\pi h/2,0)$), then follow the floor to $(d,0)$.
To see this:  Note that the brachistochrone is, by definition, the fastest route to $(\pi h/2,0)$.  By the properties of a brachistochrone, it does not speed up the route to $(\pi h/2, 0)$ to get to the floor "sooner."  Clearly, too, the floor is the fastest route from $(\pi h/2,0)$ to $(d,0)$ because the particle has the fastest possible speed (given the constraints) and also the fastest horizontal speed.  Note that the optimal curve is continuous throughout because the cycloid has vanishing derivative at the transition point... the same as the horizontal "floor."

For any point $B$ beyond $\pi h/2$, the unconstrained brachistochrone would have to go "beneath" the "floor," and is hence unacceptable.
Closely related reference.
A: Arthur wrote in a comment below the question:

My immediate guess would be to follow the cycloid which is vertical at $A$ and tangent to the floor, then when you reach the floor slide along the floor to $B$.

Arthur is exactly right if $d\geq \pi \frac{h}{2}$. (If $d\leq  \pi \frac{h}{2}$, the cycloid solution between $A$ and $B$ for the unconstrained Brachistochrone problem will not dip below the floor, and hence is the optimal solution.)
Sketched proof:

*

*It is enough to consider continuous curves $\gamma$ that can be parametrized by the $x$-coordinate. (Moving in the negative $x$-direction (or vertically for a finite period) cannot be optimal.)


*We can break the optimization problem down into smaller problems. Say, given a vertical line $\ell$ with $x$-coordinate $\in]0,d[$, and let $C$ be an arbitrary point on $\ell$. Then an optimal curve $\gamma_{AB}$ from $A$ to $B$ can be found as a concatenation of an optimal curve $\gamma_{AC}$ from $A$ to $C$ and an optimal curve $\gamma_{CB}$ from $C$ to $B$, if we in the end optimize the position of $C$ along the vertical line $\ell$ wrt. the time functional $t[\gamma_{AC}]+t[\gamma_{CB}]$, cf. Fig. 1.
  y
  ^
  |          |
 A|__        |
  |  \_______|__
  |         C|  \_____
 _|__________|________\__B______> x
  |          |

$\uparrow$ Fig.1.
(Technically, for the second leg $\gamma_{CB}$, we are here slightly generalizing the classical Brachistochrone problem (where the initial speed traditionally is assumed to be zero) to the case where the initial speed could be non-zero.)


*Let $C$ be the point where an optimal curve $\gamma_{AB}$ first touches the floor. (Could be the endpoint $B$). Then the optimal curve $\gamma_{AC}$ is just a cycloid solution for the unconstrained problem between $A$ and $C$.
A parametrization of the cycloid reads
$$\begin{align}\gamma_{AC}(\theta)~=~&\begin{pmatrix}x(\theta)\cr y(\theta)\end{pmatrix}~=~\begin{pmatrix}\frac{k^2}{2}(\theta-\sin\theta)\cr h- k^2\sin^2\frac{\theta}{2}\end{pmatrix}, \cr 
k~:=~&\frac{\sqrt{h}}{\sin\frac{\theta_C}{2}}, \qquad 
\theta~\in~[0,\theta_{C}],\end{align}\tag{0}$$
where $\theta_{C}\in[0,\pi]$ is a free parameter to be determined later. It is straightforward to calculate that the time for the first leg is
$$\begin{align}t[\gamma_{AC}]~=~&\int_{\gamma_{AC}}\! \frac{\mathrm{d}s}{v}
~=~\int_0^{\theta_C}\!\mathrm{d}\theta \sqrt{\frac{x^{\prime}(\theta)^2+y^{\prime}(\theta)^2 }{2g(h-y(\theta))}}\cr
~\stackrel{(0)}{=}~&\ldots ~=~\frac{k\theta_C}{\sqrt{2g}}.\end{align}\tag{1} $$


*If an intermediate optimal point $C$ touches the floor, then the optimal curve $\gamma_{CB}$ must be a straight line horizontally along the floor (because staying as low as possible yields the greatest speed).
Assume for the rest of the answer that $d\geq \pi \frac{h}{2}$. The time for the second leg is
$$t[\gamma_{CB}]~=~\frac{x_B-x_C}{v}~=~\frac{d-\frac{k^2}{2}(\theta_C-\sin\theta_C)}{\sqrt{2gh}}. \tag{2}$$


*If a continuous piece-wise $C^1$-curve $\gamma$ (with left- and right derivatives) has a kink in its slope, it cannot be optimal.
This argument alone shows that the optimal curve has $\theta_C=\pi$. It can also be explicitly checked from eqs. (1) & (2) that the combined time $t[\gamma_{AC}]+t[\gamma_{CB}]$ is minimized for $\theta_C=\pi$.
A: Arthur's conjecture seems very reasonable. 
First of all, we note that by conservation of energy, once the ball hits the floor its velocity is fixed. Call this value $v$: in a suitably chosen measuring system, the equation $$h = \frac{1}{2} v^2 $$ holds, from which $$ v = \sqrt{2h}$$
From the point of contact onwards, the ball will roll at constant velocity.
Let us now take the cycloid mentioned by Arthur, such that it is tangent to the floor. It is generated by a circumference of radius $\frac{h}{2}$. Moreover, it hits the floor at a horizontal distance of $ \pi r = \pi \frac{h}{2} $ from the starting point (i.e. half of the circumference). 
This means, a distance of $d - \pi \frac{h}{2}$ remain to be travelled, which occurs in a time $t_2$, $$t_2 =\frac{d - \pi r}{v}= \frac{d - \pi \frac{h}{2}}{v} = \frac{d - \pi \frac{h}{2}}{\sqrt{2h}}$$
The time $t_1$ to roll down the cycloid up to the floor equals $$ t_1 = \pi \sqrt{\frac{h}{2}}$$ as known from the unrestricted brachistochrne problem.
We can now check stationarity of Arthur's candidate solution, by varying $r$, the radius of the cycloid's circle generator.
For an infinitesimal radius variation $dr$, the "time to roll down" differential equals $$ \mathrm{d}t_1 = \frac{\pi}{\sqrt{2 h}} \mathrm{d}r$$ while the variation of $t_2$ is calculated as $$ \frac{d - \pi (\frac{h}{2} + \delta r)}{\sqrt{2h}}  -\frac{d - \pi \frac{h}{2}}{\sqrt{2h}} $$ so one concludes $$\mathrm{d}t_2 =  - \frac{\pi }{\sqrt{2h}}\mathrm{d}r $$ just equal in magnitude to $\mathrm{d}t_1$, which shows that the candidate solution is indeed stationary.
