Expressing the superposition of two cubic bezier splines as a cubic bezier spline?

97 Views Asked by At

If I have two $2$-dimensional cubic bezier splines that each:

  1. exist only along a given range on the $x$ axis, from $x_0$ to $x_1$.
  2. have one and only one $y$ value for every $x$ value along that range (they do not double back or intersect themselves).

Is it possible to express the superposition of the $y$ values of these two splines as a single cubic bezier spline? If so, what is the method of determining the control points of the new spline from the points of the two source splines?

2

There are 2 best solutions below

0
On

I don't know what you mean by "superposition".

But regardless of what it means, the answer is probably "no". A fluffy intuitive argument is as follows.

The two original Bezier curves have 16 degrees of freedom (8 2D control points). Even if you require that they have a common end-point, that still leaves 14 degrees of freedom. But a single Bezier curve has only 8 degrees of freedom, so it will not have enough flexibility to replicate the two given curves.

All of this can be made more precise and mathematically rigorous. But the current answer is at least as rigorous as your question, so it might be enough, for now.

0
On

Sorry to answer a long-dead question, but the answer is actually yes in a certain sort of way.

Bezier curves are parametric curves. You don't have $y=f(x)$, you have $y=f(t)$ and $x=f(t)$.

In your case, you have two curves, $x_a(t),y_a(t)$ and $x_b(t),y_b(t)$. If you sum the control points, you will get a third curve, $x_c(t),y_c(t)$.

This curve is the equi-parametric sum of the other two curves. That is, for any given $t, x_c(t)=x_a(t)+x_b(t)$ and $y_c(t)=y_a(t)+y_b(t)$.

Graphically, if you plot these curves on an $x,y$ plane, this may not give the results you're expecting. $x_a(t)$ and $x_b(t)$ could have very different behavior -- one might go left-to-right and the other right-to-left.

This might not satisfy your need, but it can be used in really cool ways.