Is it possible to rewrite the B-Spline Basis functions nonrecusively

152 Views Asked by At

B-Splines have a recursively-defined basis function $N_{i,j}(t)$ as shown here: $$ \newcommand{\defeq}{:=} N_{i,j}(t)\defeq\frac{t-t_i}{t_{i+j}-t_i}N_{i,j-1}(t)\frac{t_{i+j+1}-t}{t_{i+j+1}-t_{i+1}}N_{i+1,j-1}(t) $$ I would like to re-implement this in an engine that doesn't support recursion (Desmos). Is there a way to rewrite this (potentially using sums?)?

1

There are 1 best solutions below

6
On

Well, for a given degree, you can obviously just combine the recursion steps to get a closed-form expression. For common degrees (2 or 3) this is not too bad, but it gets nastier after that.

And you don’t really need recursion (in the sense of functions calling themselves), anyway — you can just use a loop.

There are definitions of b-spline basis functions that use divided differences, or convolutions, but I don’t think those would be very helpful. See (for example) Carl deBoor’s book entitled “A Practical Guide to Splines”.

For simple examples, see the answer to this question.