# Maximum distance of Bezier curve

I have a Bezier curve given by four points: a start point ($$P_0$$), an end point ($$P_3$$), and two control points ($$P_1$$ and $$P_2$$). The points lie in a certain way. $$P_1$$ and $$P_3$$ lie on the x axis. $$P_1$$ lies on a vertical line with $$P_0$$ and $$P_2$$ lies on a vertical line with $$P_3$$. $$P_1$$ and $$P_2$$ also lie on the same horizontal line. Let's say the following

\begin{aligned} P_0 &= (0,0), & P_1 &= (x_1,y_1), & P_2 &= (x_2,y_1), & P_4 &= (x_2,0) \end{aligned}

How do I get the maximum distance between the baseline (line from $$P_0$$ and $$P_3$$) and the Bezier curve? In other words, how do I get the top of the bezier curve?

If I understand correctly, your points form a rectangle aligned with the coordinate axes. I think your formula for $$P_1$$ has a typo — it should be $$P_1 = (0,y_1)$$.
In that case, the height of the Bézier curve is $$3/4$$ the height of the rectangle.
Why? Well, by symmetry, the highest point must occur where $$t = 1/2$$. If you plug $$t=1/2$$ into the equation of the Bézier curve, you’ll get the coordinates of the highest point. The $$y$$ coordinate of this point is the value you want.