Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 5 data points. I'm trying to make a b-spline that passes through these points. At each data point I also have a derivative. The b-spline must meet this condition. Anyone that has an idea of how to approach this?

share|cite|improve this question
up vote 0 down vote accepted

I'm assuming your "points" are in 2D or 3D. So, you have 5 points and 5 derivative vectors. You can insert a cubic segment between each pair of points. This will give you a cubic b-spline that is $C_1$-continuous.

Specifically, suppose your 5 points are $P_1, P_2, P_3, P_4, P_5$ and your 5 derivative vectors are $V_1, V_2, V_3, V_4, V_5$. Assign parameter values $t_1, t_2, t_3, t_4, t_5$ to the 5 points. You can use $t_1=0$, and $t_5=1$, and $t_2, t_3, t_4$ should be spaced according to the spacing of the points. Let $h_i = (t_{i+1}-t_i)/3$ for $i=1,2,3,4$.

Your b-spline should have knot sequence $$(0,0,0,0, t_2, t_2, t_3, t_3, t_4, t_4, 1,1,1,1)$$ and its control points should be $$P_1, \quad P_1 + h_1V_1, $$ $$P_2 - h_1V_2, \quad P_2 + h_2V_2,$$ $$P_3 - h_2V_3, \quad P_3 + h_3V_3, $$ $$P_4 - h_3V_4, \quad P_4 + h_4V_4,$$ $$P_5 - h_4V_5, \quad P_5$$

So, 10 control points and 14 knot values, which works out correctly for a b-spline of degree 3 (order 4).

share|cite|improve this answer
Thanks a lot. This really helped. Does this "method" have a name so that I can read more about it? – nyvaken Jan 27 '13 at 21:17
The general technology is called "deBoor-Fix dual functionals", but what I showed is a very very simple special case. You can read about this stuff in deBoor's book "A Practical Guide to Splines". – bubba Feb 4 '13 at 4:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.