Is it possible to find the control points of a quadratic bezier curve, given the starting, ending and stationary point

bezier-curveconic sections

I know from this question on SO that it is possible to get the stationary point of a bezier curve given the control points, but I want to know wether the opposite is true:

If I have the start and end points of a Parabola, and I have the maximum point, is it possible to express this a quadratic bezier curve?

I have seen this answer explaining that you usually would need 6 points on a cubic to effectively describe a bezier curve, but looking at the question itself, it describes a few special cases where you can find the control points on a cubic, and I am curious on wether a quadratic bezier curve has such points, and wether a stationary point is one of them

The variable t of the stationary point is not avalible

I am coming from a computer science background, and although im not too weak in math, any answers/articles that don't use complicated maths and keep it simple would be appreciated

If this is not possible, would it help of the stationary point is always a maximum point and the x coordinate if the max point is the mean of the x coordinates of the start and end points?

By maximum point I mean the point with the maximum value for its y coordinate and by stationary I meant the point with the maximum or minimum value for y

Best Answer

Define the following:

  • The quadratic Bézier has control points $(x_0,y_0)$ (start), $(x,y)$, $(x_2,y_2)$ (end)
  • The third known point is at $(x_1,y_1)$ with parameter $t$ (in this part of the answer, this is the point with extremal $y$-coordinate)

The curve's equation is then $$x(t)=(1-t)^2x_0+2t(1-t)x+t^2x_2\tag1$$ $$y(t)=(1-t)^2y_0+2t(1-t)y+t^2y_2\tag2$$ and the constraints are $x(t)=x_1$, $y(t)=y_1$ and $y'(t)=0$. Eliminating $y$ in the last two equations gives $$\Delta y_2t^2-2\Delta y_1t+\Delta y_1=0\qquad(\Delta c_i=c_0-c_i)$$ $$t=a\pm\sqrt{a(a-1)},a=\frac{\Delta y_1}{\Delta y_2}\qquad(\Delta y_2\ne0)$$ $$\Delta y_2=0\implies t=\frac12$$ There is a solution in general iff $a\not\in(0,1)$ and only one choice of sign will give $t\in[0,1]$. Once $t$ has been found, it may be substituted back into $(1)$ and $(2)$ to find $x$ and $y$ respectively.


If $(x_1,y_1)$ is the parabola's vertex, the third equation may be obtained from this diagram:

The curve's tangent at the vertex is perpendicular to the line passing between the midpoint of the curve endpoints and the third control point, i.e. $$\begin{bmatrix}\frac{x_0+x_2}2-x\\\frac{y_0+y_2}2-y\end{bmatrix}\cdot\begin{bmatrix}x'(t)\\y'(t)\end{bmatrix}=0$$

A resultant computation followed by factoring out bogus solutions then shows that $t$ solves the cubic $$\begin{align} (\Delta x_2^2+\Delta y_2^2)&t^3\\ -3(\Delta x_1\Delta x_2+\Delta y_1\Delta y_2)&t^2\\ +(\Delta x_1(2\Delta x_1+\Delta x_2)+\Delta y_1(2\Delta y_1+\Delta y_2))&t\\ -(\Delta x_1^2+\Delta y_1^2)&=0 \end{align}$$