# Bézier control points for drawing an interpolating cubic spline *function*

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)?

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

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})$.