# Manually deducing the quadratic uniform B-spline basis functions

I'm trying to manually (i.e. without fancy equations like the Cox-DeBoor recurrence relation) deduce the quadratic uniform B-spline basis functions.

In the book "Curves and Surfaces for Computer Graphics" it is explained, but there is one step that is not clear to me. Summary of the process:

A quadratic curve depends on 3 control points (say $\mathbf{P_0}$, $\mathbf{P_1}$ and $\mathbf{P_2}$ -- or $\mathbf{P_1}$, $\mathbf{P_2}$ and $\mathbf{P_3}$).

For each control point there is a basis/blending/weight function -- $a(t)$, $b(t)$ and $c(t)$, such that

\begin{align}Segment_1 = a(t)\mathbf{P_0} + b(t)\mathbf{P_1} + c(t)\mathbf{P_2}\\Segment_2 = a(t)\mathbf{P_1} + b(t)\mathbf{P_2} + c(t)\mathbf{P_3}\end{align}

The basis functions are of course quadratic polynomials (defined on the unit interval $[0, 1]$)

\begin{align}a(t) = a_0 + a_1t + a_2t^2\\b(t) = b_0 + b_1t + b_2t^2\\c(t) = c_0 + c_1t + c_2t^2\end{align}

Now, the requirements for a quadratic B-spline is that two consecutive segments join with $C^1$ continuity, i.e.

\begin{align}a(1)\mathbf{P_0}+b(1)\mathbf{P_1}+c(1)\mathbf{P_2} &= a(0)\mathbf{P_1} + b(0)\mathbf{P_2}+c(0)\mathbf{P_3}\\a'(1)\mathbf{P_0}+b'(1)\mathbf{P_1}+c'(1)\mathbf{P_2} &= a'(0)\mathbf{P_1} + b'(0)\mathbf{P_2}+c'(0)\mathbf{P_3}\end{align}

Now the author says that, because the four points $\mathbf{P_i}$ are arbitrary,

\begin{align}a(1)&=0\\b(1)&=a(0)\\c(1)&=b(0)\\c(0)&=0\end{align}

And something similar for the derivatives of the basis functions,

\begin{align}a'(1)&=0\\b'(1)&=a'(0)\\c'(1)&=b'(0)\\c'(0)&=0\end{align}

Now, I see that this is _a_ solution (that is valid for all combinations of four points), but isn't it the case that for each individual case of four points there are other solutions (e.g. such that $a(1) \neq 0$)?

Besides these 8 equations, there is the partition-of-unity property of the basis functions such that there are now 9 equations to solve the 9 unknown coefficients of the basis functions ($a_0$, $a_1$, $a_2$, $b_0$, $b_1$, $b_2$, $c_0$, $c_1$, $c_2$). This results in the familiar quadratic basis functions

\begin{align}B_{02} &= \frac{1}{2}(t^2-2t+1) \\ B_{12} &= \frac{1}{2}(-2t^2+2t+1)\\ B_{22} &= \frac{1}{2}t^2\end{align}

So in conclusion: I thought that using these requirements, a unique curve could be defined, but it seems that there exist other solutions?

Could somebody shine some light on this method for deducing the basis functions?

-

The idea is that the curves are linear in the control points and the coefficients $a,b,c$ don't depend on the control points. Then one can argue as the author does. The way you're thinking about it, you want to allow the coefficients to depend on the control points. If you do that, it would be clearer to write e.g. $a(t;\mathbf P_0)\mathbf P_0$. In that case only the direction of this vector would be fixed by $\mathbf P_0$, and its magnitude would be an arbitrary value without any specified relation to the control points; it's not surprising that this wouldn't fix the coefficients.

-
What do you mean by "the curves are linear in the control points"? –  Ailurus Mar 1 '12 at 15:49
@Ailurus: I mean that on either curve for every $t$ the point $\mathbf P(t)$ of the curve depends linearly on each control point, that is, if we change $\mathbf P_0$ by $\mathbf\Delta_0$, then $\mathbf P(t)$ changes by $\lambda(t)\mathbf\Delta_0$, where the constant of proportionality $\lambda(t)$ depends on $t$ but not on the control points. –  joriki Mar 1 '12 at 16:00
Ok, so in fact it would be possible to define other basis functions such that two segments would join with $C^1$ continuity -- but when adding a third segment, it probably wouldn't join the second segment with $C^1$ continuity. If I understand it correctly, you only have that guarantee when you use the standard uniform B-spline basis functions. –  Ailurus Mar 1 '12 at 16:11
@Ailurus: I don't know about that; that's not what I was trying to say. What I'm trying to say is that a) the linear dependence on the control points is part of the standard approach to this and the author's argument that you questioned is based on that approach, and b) your alternative approach has almost no constraints. All you're demanding is $C^1$ continuity, with almost no dependence on the control points. The idea is for the curve to somehow follow the control points, not just to be some arbitrary $C^1$ curve. –  joriki Mar 1 '12 at 16:24
I get your point. In fact, one could define an infinite number of $C^1$ curves (consisting of 2 segments) using 4 points. The thing is that you just don't have any guarantee that a third segment would join the existing curve with $C^1$ continuity. The B-spline basis functions do guarantee this -- but I'm not sure whether they are unique. –  Ailurus Mar 1 '12 at 16:45

Let me try to shed a little additional light here. The goal with these B-splines is to find three quadratic functions, $t \mapsto a(t)$, $t \mapsto b(t)$, and $t \mapsto c(t)$, with the property that the questioner posed above, namely, that for any collection of points, Segment1 and Segment2 join with some degree of continuity, and that the three functions have the partition of unity property.

The important thing to understand in the paragraph above is the order: you're supposed to find three polynomials -- you have to commit to them right from the start -- with the property that for any triple of points, the continuity and partition of unity properties hold.

You can ask a different question, like "Is it possible, for some set of control points, to find quadratics with such-and-such properties?", and the answer may well be, "Yes, there are many sets of quadratics that do that." But that's not the questions for which the b-spline basis functions are the answer.

--John

-