0

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 Answers1

0

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.

bubba
  • 43,483
  • 3
  • 61
  • 122
  • Care to show the definitions that use divided differences or convolutions? I haven't found them anywhere.

    I'm looking for a generic definition for any degree.

    – CATboardBETA Oct 24 '23 at 21:37
  • Added a reference – bubba Oct 24 '23 at 22:26
  • That book has nothing to do with b-splines. It's very interesting, but not what I'm looking for. B-Splines $\in$ Splines, Splines $\neq _{\kern-.1em n}$ B-Splines. – CATboardBETA Oct 25 '23 at 02:57
  • Interesting that you think that, since deBoor has been one of the main proponents of b-splines, over the years. The deBoor-Cox algorithm for evaluating b-splines is even named after him. And, in fact, one of the main results of the theory is that every spline is a b-spline. – bubba Oct 25 '23 at 11:05
  • https://en.wikipedia.org/wiki/De_Boor%27s_algorithm – bubba Oct 25 '23 at 11:08
  • Okay, that's my bad. I'm sorry. Thank you, I'll look more at that book now. – CATboardBETA Oct 25 '23 at 11:37