Algorithms – Finding Control Points for a Given Curve

algorithmsbezier-curveparametricspline

I've been reading all possible papers about splines for a couple of days now and couldn't answer my own question.

  • All papers I was able to find start the definition of Bezier Curve by either introducing it's parametric form with known positions of control points. Wikipedia.
  • Or by fitting natural splines to the curve

None of the above actually covers my problem, which is, simply put: I have the numerical values of coordinates $(x, f(x))$ of a curve and I need to find the positions of control points.

So basically I want to find the position of control points so that the generated spline would fit perfectly over my coordinates. I'd also need knots values, obviously. Any ideas?

Best Answer

It is not clear whether the "control points" you need is for Bezier curve or for B-spline curve. Since many graphic toolkits only take quadratic/cubic Bezier curves, I will assume this is what you want.

For creating multiple Bezier curves interpolating a given set of data points, you can go with Catmull-Rom spline interpolation or natural spline interpolation. Both schemes will produce a cubic Bezier curve in between each two data points but the natural spline interpolation will require solving a linear equation set.

If you really want to do B-spline interpolation, please refer this link for more details. You will have to decide a knot vector in advance, which is typically derived from the parameters for the points so that the linear equation matrix is not ill-conditioned.