Just to make sure that I understood you correctly:
you want to have a function f(xl,yl) -> (x,y)
I would guess that this is not unambiguously feasible unless you specify at least the x values for which you want the y. This is because multiple sets of (x,y) can lead to the same spline function. Using only the values of the spline function at different points xl does not make it any easier.
I assumed that given a set of discrete xy points and their corresponding spline (the result from, say, Spline1D(x, y)), I could get a unique control polygon. Ultimately I’d like to get a measure of how much the spline needed to “turn” to fit said points. I had hoped to get such a measure from the angles between the straight lines composing the polygon…
I think the (x,y) coordinates are the knots of the spline, which is different from the control points. I suspect that the control points are a artificial construct, and that these help visualize how the spline is generated, but do not have anything to do with the spline’s properties…
I am not sure what you are looking for here. B-splines are defined by a set of knots, are evaluated at some values x, and fit using a linear solution or least squares, to values or various derivatives. The x may or may not coincide with the knots — they don’t even have the same length, depending on how you set up the problem and the order of the splines
I think you are confusing B-splines with Bezier curves, they are different things.
Also, generally for B-splines, no “polygon” drawn, say, tangentially at various points would determine the spline except for some very special cases.
You may find reading an intro text about B-splines helpful.
Thanks for reaching out. I think you have a misunderstanding of knots here as it really is just a list of number and not of coordinates.
As mentioned I think the control polygon is not well defined. I normally construct it the other way around. It’s interesting though. Maybe one can dive deeper into the Julia package to find it out.
I think I’m not quite sure what you’re interested in exactly. Maybe just curvature? Or what do you mean by “turn”?
My understanding of that blog post is that it describes how to approximate a polygon with B-splines. Reconstruction of such a polygon is an interesting problem, but I am not sure it has a unique solution.
What I’m truly after is some reliable measure of how curvy a section of a trajectory is.
I have a trajectory, a set of xy coordinates + time. These are noisy and not entirely reliable. I want to smooth the trajectory using splines. These trajectories are easily divided into two parts:
a more or less straight part where there are hardly any turns larger than 45 degrees.
a more curvy part where there is a mix of turns, some of which are 189 degrees.
I naively thought that it would be useful to describe the curviness of the trajectory as a function of the angle between each subsequent segments of the control polygon. This is why I’ve been asking about these control points/polygon…
At the end of the day I’m trying to do three things in one shot: smooth the data, allow for interpolation, detect where the straight part ends and the curvy part begins.
You could calculate the second derivative of the spline approximation at various points in that section. It is easy with B-splines (but make sure you use at least cubic).