Conditions that guarantee a composite Bezier curve in the cartesian plane represents a function?

292 Views Asked by At

Context

I am allowing users of my application to control a curve connecting $(0,0)$ and $(1,1)$. There are a finite number of knots that are evenly spaced horizontally. The user can specify the height of the curve at each of these knots.

The curve is formed numerically by computing and patching together cubic Bézier curves subject to the following constraints:

  • $B''(t) = 0$ at each end of the composite curve;
  • $B$ is $C^2$ at each knot.

I would like the resulting curve to represent a function $y = f(x)$. Intuitively, I am guessing that there is probably a relationship between the horizontal knot separation and the maximum vertical separation of consecutive knots that will guarantee the composite curve represents a function. However, I have not been able to prove this analytically. Edit: since the $x$-coordinate of a Bézier curve depends only on the $x$-coordinates of its knots and control points, this hypothesis cannot be true.

Question

Is there a known result that describes when a composite Bézier curve (or more generally, any parametric curve) in the cartesian plane represents $y$ as a function of $x$?

If not, is there a simple derivation that I'm missing that shows a certain bound on the variation in horizontal knot locations will be enough to guarantee the result I'm looking for?

1

There are 1 best solutions below

1
On

You are constructing a function $t \mapsto (x(t), y(t))$. Suppose the mapping $t \mapsto x(t)$ is linear -- say $x(t) = a + bt$. Then $t = (x-a)/b$ and so $y=y((x-a)/b$; in other words, $y$ is a function of $x$. This condition is sufficient, but it's not necessary. Necessary conditions would be much more complex, I believe.

Thinking in terms of Bezier curves, the linearity condition means that the $x$-coordinates of the four control points of the curve have to be evenly distributed.