I've done a spline interpolation of a 3D path using 2 2D fits. Using the interpolation condition as well as the requirement to be 2 times differentiable I got the required equations to interpolate my 3D path. However I came to realize, that I disregarded the fact, that the paths are not monotonic due to obstacles and therefore the fitted splines can't be calculated.
I can't find anything on spline fitting without monotonous data-sets. Is there a way to adopt to this fact? (I found out, that the points have to satisfy the (Schoenberg-Whitney) conditions, which basically looks like monotonicity to me to be uniquely fit by least squares).
Any suggestions for adoptions or different algorithms? Only thing by now I could find is this: heremite, which requires the derivatives at the endpoints, which is not ideal for my purposes. I would love something as simple as "regular" splines (3rd order polynomials with continuity conditions).
I also found this question, which only states something about hermitian polynomials (which I like to avoid).
In the end this is used for a control algorithm, which needs the curves to be defined implicitly (not parametric). For example y - p(x) = 0
. What is not possible for me is: p(t)=y, x(t)
where t is the parameter. If the parameter can be eliminated, yielding an implicit representation, it's fine.
You can generate monotonicity for any series of 3D points by simply taking the accumulated distance from point to point as the independent (monotonic) parameter. Think of it as the length of a piecewise linear path
p
connecting all the points ...Edit: ... like in (pseudo code):
Once you have this parameter you can do three spline curve fits for the three dimensions (x, y and z) separately. That way your 3D curve fitting can deal with any conceivable series of points. Using this path
p
for the spline interpolation will also make it more "physical" as points close together will be treated as such.For simplicity - especially if your data points are more or less equally spaced - you could simply use the ordinal numbers of each point (like 0, 1, 2, 3, ...) as the independent monotonously increasing parameter.