How to find the control point $Q$ of a quadratic bezier curve $PQR$ given the solution as a kinematic equation (constant acceleration)?

51 Views Asked by At

First of all, I already know the solution; that is not what I'm interested on. I found it by trial and error using Desmos for the visual feedback, as I was unable to solve it algebraically. So here are the equations that I'm using as basis:

edit: I treated all variables in all equations as vectors even though some of them are points. Only the parameter $u$ and time $t$ are scalars.

Let $PQR$ be a bezier curve with parameter $u$ where $P$ and $R$ are pivots and $Q$ is the control point.

$$PQR = (1-u)^2P+(1-u)uQ+u^2R\tag{1}$$

And there is the following equation for which all values are known.

$$S_f=S_i+V_it+\frac{1}{2}at^2\tag{2}$$

What are the values $P$, $Q$, $R$, and $u$ for (1) when (1) and (2) are equivalent.

Here is where I get stuck, at least in the math because by applying logic I'm able to stablish the following:

$$P = S_i, R = S_f, u = t$$

My reasoning is that since the bezier curve traces the trajectory of the object described in the kinematic function above, then the pivot point $S$ must be the initial location, and if I arbitrarily choose $R$ to be the final location then the time $t$ must equal the parameter $u$. So at this point all I have left to solve is the control point $Q$. With trial and error I was able to find out that:

$$Q = \frac{S_f+S_i}{2} - \frac{at^2}{4}$$

I just can't find how to derive that function algebraically. I'm just taking shots in the dark at this point.

1

There are 1 best solutions below

0
On BEST ANSWER

A key fact that you might be missing is that the middle control point $Q$ of a quadratic Bézier is the intersection of the tangents at the other two points.

It looks like you’re trying to convert the parameterization $S_f(t)=S_i+V_it+\frac12at^2$ of the parabolic arc for $0\le t\le1$ into a quadratic Bézier curve with endpoints at $S_f(0)$ and $S_f(1)$. The endpoints are $P=S_f(0)=S_i$ and $R=S_f(1)=S_i+V_i+\frac12a$, while the tangent directions are, respectively, $V_i$ and $V_i+a$. With a bit of algebra the intersection of the two tangents can be found to be $Q=S_i+\frac12 V_i$. In fact, if you simplify the Bézier expression $$(1-t)^2S_i+2t(1-t)\left(S_i+\frac12 V_i\right)+t^2\left(S_i+V_i+\frac12a\right),$$ you’ll end up with your original parameterization—they match point for point.

If $t$ lies in some other interval $[t_i,t_f]$, then you have a choice: to maintain the correspondence $u=t$ so that the same value of the parameter in the two parameterizations produces the same point, you need to use $S_f(0)$ and $S_f(1)$ as the endpoints of the Bézier curve, as above. On the other hand, if you want the Bézier curve to trace the same arc, you’ll use the endpoints and tangents at $t_i$ and $t_f$, but use $u={t-t_i\over t_f-t_i}$ as its parameter.