Related to my previous question about the type of curve Photoshop's Curves interface uses, it seems it uses an interpolating cubic spline function: for a set of xi, yi pairs defined by the user, we can find a cubic spline f(x) such that f(xi) = yi for all the points.

On the other hand, this clear explanation has helped me draw the basis spline (Section 4) and the natural spline (Section 5) for the xi, yi pairs with SVG Bézier paths, but these are parametric curves where x and y are both functions of t.

I feel like I may be circling the obvious, but I'm having a hard time applying this knowledge to derive the Bézier control points for a non-parametric curve, where y = f(x). (Section 7 of the aforementioned paper makes it sound like it should be apparent how to do it)

Edit 1: Looks like my question may be overlapping with this one, where one answer suggests either a Catmull-Rom or a Natural spline. So I guess what's not clear is how to use any of these techniques to obtain curves that still retain the aspect of a function (i.e. no multiple y values for a single x)?

  • $\begingroup$ This is a related question wherein the knots are evenly spaced on the x axis, but what if they're not? $\endgroup$ – Dan Burzo Mar 6 '18 at 12:55
  • $\begingroup$ A non-parametric curve $y=f(x)$ is identical to a parametric curve $x=t,y=f(t)$. $\endgroup$ – Rahul Mar 11 '18 at 5:34

Catmull-Rom and Natural spline are both ways for creating a cubic spline curve interpolating a given set of points. Typically, the curve will be in parametric form where x and y are both function of t. For parametric spline interpolation, assigning a parameter to each data point is the most essential step, which is often referred as parametrization. Typically, we will use either chord-length or centripetal parametrization.

If you need "cubic spline function", all you need to do is to use $t=(x-x_{min})/(x_{max}-x_{min})$ for parametrization where $x_{min}$ is the smallest $x$ value and $x_{max}$ the largest $x$ value among your data points. You can choose either Catmull-Rom or Natural spline to construct your "spline function". Afterwards, evaluating the spline function will simply require an additional step to convert $x_i$ to $t_i$ as $t_i=(x_i-x_{min})/(x_{max}-x_{min})$.

  • $\begingroup$ After much contemplation I think I understand the process. Am I right to say that this algorithm describes the reparametrization of the Bézier curve? $\endgroup$ – Dan Burzo Apr 12 '18 at 8:28
  • $\begingroup$ yes. It is a form of reparametrization. $\endgroup$ – fang Apr 13 '18 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.