4
$\begingroup$

Before I elaborate, I do not mean a quadratic function! I mean a quadratic curve as seen here. With these curves, you are given 3 points: the starting point, the control point, and the ending point. I need to know how to find the vertex of the curve. Also, I am talking about Bézier curves, but just quadratic Bézier curves-the ones with only 3 points.

$\endgroup$
0

2 Answers 2

4
$\begingroup$

Given the parametric parabola:

$$ P(t) = P_0 (1 - t)^2 + 2 P_1 t (1 - t) + P_2 t^2 $$

The vertex of a parabola is where the magnitude of the derivative is at a minimum. The component-wise derivatives are:

$$ x'(t) = 2 (x_0 - 2 x_1 + x_2) t + 2 (x_1 - x_0) \\ y'(t) = 2 (y_0 - 2 y_1 + y_2) t + 2 (y_1 - y_0) $$

We want to minimize the magnitude of the derivative $x'(t)^2 + y'(t)^2 = a t^2 + b t + c$, but it's known that the minimum of the parabola $a t^2 + b t + c$ is at the vertex:

$$ t = -\frac{b}{2a} $$

Expanding and then factoring using dot products gives:

$$ t = \frac{(P_0 - P_1) \cdot (P_0 + P_2 - 2 P_1)}{(P_0 + P_2) \cdot (P_0 + P_2) - 4 P_1 \cdot (P_0 + P_2 - P_1)} $$

Note that the common factor of $P_3 = P_0 + P_2$ can be pulled out for more efficient computation:

$$ t = \frac{(P_0 - P_1) \cdot (P_3 - 2 P_1)}{P_3 \cdot P_3 - 4 P_1 \cdot (P_3 - P_1)} $$

$\endgroup$
2
$\begingroup$

A nice question! And it has a nice answer. I arrived at it by a series of hand-drawn sketches and scribbled calculations, so I don't have time right now to present the derivation. But here is the answer:

We are given three point $P_0$, $P_1$, and $P_2$ (the start-, control-, and end-points). The Bézier curve for these points is the parabola through $P_0$ and $P_2$ whose tangents at $P_0$ and $P_2$ coincide with the lines $P_0P_1$ and $P_1P_2$ respectively. It has the parametric form $$B(t) = (1-t)Q_0(t) + tQ_1(t)$$ where $$Q_0(t) = (1-t)P_0+tP_1$$ and $$Q_1(t)=(1-t)P_1+tP_2$$

Here is what you have to do to find the vertex of the parabola:

Complete the parallelogram $P_0P_1P_2P_3$ by setting $P_3 = P_0 + P_2 - P_1$. Find the parameter $t$ such that $P_0X(t)P_1$ is a right angle, where $X(t)$ is the point on $P_1P_3$ equal to $(1-t)P_1+tP_3$. Then the vertex of the parabola is the point $B(t)$.

Note that $t$ is not necessarily in $[0,1]$.

Briefly, the idea is that we follow the tangent $Q_0(t)Q_1(t)$ around the curve until the length $|Q_0(t')B(t')|$ is equal to the length $|P_0Q_0(t')|$. Then the symmetry dictates that the vertex of the parabola is reached when $t = t'/2$. You can obtain this value of $t$ by the above procedure.

$\endgroup$
1
  • $\begingroup$ As Tony pointed out, getting the formula in an xy plane as I did isn't enough. (So I deleted my incorrect post on this) $\endgroup$
    – coffeemath
    Oct 20, 2012 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .