for a b-spline of degree 2. Knot vector k = [0,0,0,0.33, 0.66, 1, 1, 1] with 4 non-zero control points P0,...P3.
Using the recursive formulation:
f(t) = P0*N0,2(t) + P1*N1,2(t) +... P3*N3,2(t)
Ni,0(t) = 1 if k <= t < k[i+1] and k < k[i+1]
= 0 otherwise
Ni,p(t) = (t - k)/(k[i+p] - k)*Ni,p-1(t) + (k[i+p+1] - t)/(k[i+p+1] - k[i+1])*Ni+1,p-1
Now I know that at t = 1 I'm at the end of my spline and I should see that N3,2(1) = 1
But when I plug in the values I get N3,2(1) = 0
Let's look at N3,2(1):
First we can see that Ni,0(1) is non-zero only for i = 4 since 0.66 <= 1.0 < 1.0 and even then I'm fudging that < into a <= since it's the end of the spline, so I'm treating it specially. So N4,0(1) = 1 the rest are 0
N3,2(1) = C1*N3,1(1) + C2*N4,1(1)
C1 = (1-0.33)/(1.0-0.33) = 1.0
C2 = (1-1)/(1-0.66) = 0
so,
N3,2(1) = N3,1(1)
N3,1(1) = D1*N3,0(1) + D2*N4,0(1) = D1*0 + D2*1 = D2
D2 = (k[5] - 1)/(k[5]-k[4]) = (1-1)/(1-0.66) = 0
ack. The numerator goes to zero so the whole thing does.
What am I doing wrong? I'm following the formula mostely:
http://mathworld.wolfram.com/B-Spline.html
I know this is not a very efficient way to evaluate a b-spline, so no "why aren't you doing it this way..." answers please.
Alternately, if anyone has the b-spline code I already wrote about 4 years ago you can just send that to me

- Michael Alexander Ewert