The meaning of knot insertion is adding a new knot into the existing knot vector without changing the shape of the curve. This new knot can be equal to an existing one and in this case the multiplicity of that knot is increased by one. Because of the fundamental equality m = n + p + 1, after adding a new knot, the value of m is increased by one, and, consequently, either the number of control points or the degree of the curve must also be increased by one. Changing the degree of the curve will change the shape of the curve globally and will not be considered. Therefore, inserting a new knot causes a new control point to be added. In fact, some existing control points are removed and replaced with new ones by corner cutting.
Although knot insertion looks not very interesting, it is one of the most important algorithms for Bspline and NURBS curves since many other useful algorithms will be based on knot insertion. Therefore, we shall start with knot insertion algorithms. In the following, we shall present an algorithm for inserting a single knot.
The left figure below shows a clamped Bspline curve of degree 4 with uniformly spaced knots. The right figure shows the result after a new knot u = 0.5 is inserted. As you can see, the shape of the curve does not change; however, the defining control polyline is changed. In fact, four new control points (in red) replace the original control points p_{4}, p_{5} and p_{6}, and three line segments (in yellow) cut the corners at p_{4}, p_{5} and p_{6}.
Suppose the new knot t lies in knot span [u_{k}, u_{k+1}). From the strong convex hull property, p(t) lies in the convex hull defined by control points p_{k}, p_{k1}, ..., p_{kp} and all other basis functions are zero. Thus, the knot insertion computation can be restricted on control points p_{k}, p_{k1}, ..., p_{kp}. The way of inserting t is to find p new control points q_{k} on leg p_{k1}p_{k}, q_{k1} on leg p_{k2}p_{k1}, ..., and q_{kp+1} on leg p_{kp}p_{kp+1} such that the old polyline between p_{kp} and p_{k} (in black below) is replaced by p_{kp}q_{kp+1}...q_{k}p_{k} (in orange below) by cutting the corners at p_{kp+1}, ..., p_{k1}. All other control points are unchanged. Note that p1 control points of the original control polyline are removed and replaced with p new control points.
Fortunately, the positions of new control points q_{i}'s are easy to compute. The formula for computing the new control point q_{i} on leg p_{i1}p_{i} is the following:
where the ratio a_{i} is defined below:
In summary, to insert a new knot t, we first find the knot span [u_{k}, u_{k+1}) that contains this new knot. With k available, p new control points q_{kp+1}, ..., q_{k} are computed with the above formula. Finally, the original control polyline between p_{kp} and p_{k} is replaced with the new polyline defined by p_{kp}, q_{kp+1}, q_{kp+2}, ..., q_{k1}, q_{k} and p_{k}. Note that after inserting a new knot, the knot vector becomes u_{0}, u_{1}, ..., u_{k}, t, u_{k+1}, ..., and u_{m}. If the new knot t is equal to u_{k}, the multiplicity of u_{k} is increased by one.
The above computation scheme can be illustrated with the following diagram. First, the affected control points are listed on the left column. Then, the computed new control points are listed on the second column. Note that the number of new control points is one less than the affected control points. The computation of new control point q_{i}, where kp+1 <= i <= k, requires two original control points p_{i1} and p_{i} with coefficients 1a_{i} and a_{i}, respectively. After the computation, we shall use the points surrounded by the blue dotted line to replace those not in the region. All unaffected control points are preserved. Therefore, the original set of control points p_{kp}, p_{kp+1}, ..., p_{k1}, p_{k} is replaced with p_{kp}, q_{kp+1}, ..., q_{k1}, p_{k}.
Let us take a look at a geometric interpretation of a_{i}. From its definition, a_{i} is ratio of dividing interval [u_{i}, u_{i+p}) by the value of t as shown below:
There are k a_{i}'s, each of which covers p knot spans (i.e., [u_{i}, u_{i+p})). If we stack these intervals together and align at the value of t, we have the following diagram:
Therefore, the position of t divides knot spans [u_{k}, u_{k+p}), [u_{k1}, u_{k+p1}), ..., [u_{kp+1}, u_{k+1}) into ratios a_{k}, a_{k1}, ...,, a_{kp+1}, which, in turn, provide the same ratios for dividing legs p_{k}p_{k1}, p_{k1}p_{k2}, ... p_{kp}p_{kp+1}. ,
Suppose we have a degree 3 Bspline curve with a knot vector as follows:
u_{0} to u_{3}  u_{4}  u_{5}  u_{6}  u_{7}  u_{8} to u_{11} 
0  0.2  0.4  0.6  0.8  1 
We want to insert a new knot t = 0.5. Since t = 0.5 lies in knot span [u_{5},u_{6}), the affected control points are p_{5}, p_{4}, p_{3} and p_{2}. To determine the three new control points q_{5}, q_{4} and q_{3}, we need to compute a_{5}, a_{4} and a_{3} as follows:
a_{5} = (t  u_{5}) / (u_{8}  u_{5}) = (0.5  0.4) / ( 1  0.4) = 1/6Therefore, the three new control points are
a_{4} = (t  u_{4}) / (u_{7}  u_{4}) = (0.5  0.2) / ( 0.8  0.2) = 1/2
a_{3} = (t  u_{3}) / (u_{6}  u_{3}) = (0.5  0) / ( 0.6  0) = 5/6
q_{5} = (1  1/6)p_{4} + (1/6)p_{5}The new control polyline becomes p_{0}, p_{1}, p_{2}, q_{3}, q_{4}, q_{5}, p_{5}, ...., and the new knot vector is
q_{4} = (1  1/2)p_{3} + (1/2)p_{4}
q_{3} = (1  5/6)p_{2} + (5/6)p_{3}
u_{0} to u_{3}  u_{4}  u_{5}  u_{6}  u_{7}  u_{8}  u_{9} to u_{12} 
0  0.2  0.4  0.5  0.6  0.8  1 
Since the original Bspline curve has p = 3 and m = 11, we have n = m  p  1 = 11  3  1 = 7 and hence 8 control points. The following is a Bspline curve satisfying this condition and its basis functions:
The three blue rectangles are q_{3}, q_{4} and q_{5}. After inserting t = 0.5, the corners at p_{3} and p_{4} are cut, yielding the following Bspline curve and its basis functions. Note that the shape of the curve does not change:
The following diagram shows the relationship between the old and new control points. Note that the new set of control points contains p_{0}, p_{1}, p_{2}, q_{3}, q_{4}, q_{5}, p_{5}, p_{6} and p_{7}.
The relationship among a_{j}'s, u_{j}'s, and t are shown below:
u_{0} to u_{4}  u_{5}  u_{6}  u_{7}  u_{8}  u_{9}  u_{10}  u_{11}  u_{12} to u_{16} 
0  0.125  0.25  0.375  0.5  0.625  0.75  0.875  1 
We want to insert a new knot t = 0.5, which is equal to an existing one (i.e., t = u_{8} = 0.5). The following is a Bspline curve of degree 4 and its basis functions before the new knot t is inserted.
Since t is in [u_{8},u_{9}), the affected control points are p_{8}, p_{7}, p_{6}, p_{5} and p_{4}. The coefficients are computed as follows:
a_{8} = (t  u_{8}) / (u_{12}  u_{8}) = (0.5  0.5) / (1  0.875) = 0The new control points are
a_{7} = (t  u_{7}) / (u_{11}  u_{7}) = (0.5  0.375) / (0.875  0.375) = 1/4
a_{6} = (t  u_{6}) / (u_{10}  u_{6}) = (0.5  0.25) / (0.75  0.25) = 1/2
a_{5} = (t  u_{5}) / (u_{9}  u_{5}) = (0.5  0.125) / (0.625  0.125) = 3/4
q_{8} = (1  0)p_{7} + 0p_{8}The new control point q_{8} is equal to the original control point p_{7}. In fact, if t is equal to a knot, say u_{k}, then
q_{7} = (1  1/4)p_{6} + (1/4)p_{7}
q_{6} = (1  1/2)p_{5} + (1/2)p_{6}
q_{5} = (1  3/4)p_{4} + (3/4)p_{5}
a_{k} = (t  u_{k}) / (u_{k+p}  u_{k}) = 0Consequently, we have
q_{k} = (1  0)p_{k1} + 0p_{k} = p_{k1}That is, if the new knot t to be inserted is equal to an existing simple knot u_{k}, then q_{k}, the last new control point, is equal to p_{k1}. The following diagram is the computation scheme:
The figure shown at the beginning of this example shows the new control points and the new control polyline in orange, Please note that the new control points are p_{0}, p_{1}, p_{2}, p_{3}, p_{4}, q_{5}, q_{6}, q_{7}, q_{8} = p_{7}, p_{8}, p_{9}, p_{10} and p_{11}. The curve and its basis functions after new knot t = 0.5 inserted is shown below.
The relationship among a_{j}'s, u_{j}'s, and t are shown below:
What if the new knot t is inserted at a multiple knot? Suppose t is inserted at knot u_{k} of multiplicity s. Hence, we have s consecutive equal knots: u_{k} = u_{k1} = u_{k2} = .... = u_{ks+1} and u_{ks+1} being not equal to u_{ks}. In the computation of coefficients a_{k}, ...., a_{kp+1}, we have the following:
a_{k} = (t  u_{k}) / (u_{k+p}  u_{k}) = (u_{k}  u_{k}) / (u_{k+p}  u_{k}) = 0Hence, coefficients a_{k}, ...., a_{kp+1} are all zero and consequently we have
a_{k1} = (t  u_{k1}) / (u_{k+p1}  u_{k1}) = (u_{k}  u_{k1}) / (u_{k+p1}  u_{k1}) = 0
..........
a_{ks+1} = (t  u_{ks+1}) / (u_{ks+1+p}  u_{ks+1}) = (u_{k}  u_{ks+1}) / = 0
q_{k} = (1  a_{k})p_{k1} + a_{k}p_{k} = p_{k1}This shows that if the new knot t is inserted at a knot u_{k} of multiplicity s, then the last s new control points, q_{k}, q_{k1}, ..., q_{ks+1} are equal to the original control points p_{k1}, p_{k2}, ..., p_{ks}. If s = 1 (i.e., simple knot), q_{k} is equal to p_{k1}, which is exactly what has been discussed in Example 2. If s = 0 (i.e., t is not a knot), then all control points from p_{kp} to p_{k} are involved. This is the case of Example 1. The following diagram is the computation scheme:
q_{k1} = (1  a_{k1})p_{k2} + a_{k1}p_{k1} = p_{k2}
..........
q_{ks} = (1  a_{ks+1}) p_{ks} + a_{ks+1}p_{ks} = p_{ks}
Suppose we have n + 1 control points p_{0}, p_{1}, ..., p_{n} with associated weights w_{0}, w_{1}, ..., w_{n}, a knot vector U and a degree p. Let p_{i} = (x_{i}, y_{i}, z_{i}). Then, control points P_{i} = ( w_{i}x_{i}, w_{i}y_{i}, w_{i}z_{i}, w_{i} ), 0 <= i <= n, and knot vector U define a four dimensional Bspline of degree p. We can insert a knot t to this four dimensional Bspline yielding a new set of control points Q_{i} = ( X_{i}, Y_{i}, Z_{i}, W_{i} ), 0 <= i <= n. Projecting these control points back to the threedimensional space by dividing the first three components with the fourth one yields the new set of control points of the given NURBS curve.
Let us take a look at an example. Suppose we have 9 knots
u_{0} to u_{3}  u_{4}  u_{5} to u_{8} 
0  0.5  1 
and a NURBS curve of degree 3 defined by the following 5 control points in the xyplane:

x  y  w 
p_{0}  70  76  1 
p_{1}  70  75  0.5 
p_{2}  74  75  4 
p_{3}  74  77  5 
p_{4}  40  76  1 
The following shows the curve and its basis functions.
Let us insert a new knot t = 0.4. Since t is in knot span [u_{3}, u_{4}) and the degree of the NURBS curve is 3, the affected control points are p_{3}, p_{2}, p_{1} and p_{0}. Since this is a NURBS curve, we shall use homogeneous coordinates by multiplying all control points with their corresponding weights. Call these new control points P_{i}:

x  y  w 
P_{0}  70  76  1 
P_{1}  35  37.5  0.5 
P_{2}  296  300  4 
P_{3}  370  385  5 
Note that since P_{4} is not affected, it is not computed in the above table. Then, we shall compute a_{3}, a_{2} and a_{1} as follows:
a_{3} = (t  u_{3})/ (u_{6}  u_{3}) = (0.4  0)/(1  0) = 0.4The new control points Q_{3}, Q_{2} and Q_{1} are:
a_{2} = (t  u_{2})/ (u_{5}  u_{2}) = (0.4  0)/(1  0) = 0.4
a_{1} = (t  u_{1})/ (u_{4}  u_{1}) = (0.4  0)/(0.5  0) = 0.8
Q_{3} = (1  a_{3})P_{2} + a_{3}P_{3} = ( 325.6, 26, 4.4 )Projecting these three four dimensional control points by dividing the first two components with the third (the weight), we have
Q_{2} = (1  a_{2})P_{1} + a_{2}P_{2} = ( 97.4, 142.5, 1.9 )
Q_{1} = (1  a_{1})P_{0} + a_{1}P_{1} = ( 42, 14.8, 0.6 )
q_{3} = ( 74, 5.9 ) with weight 4.4
q_{2} = ( 51.3, 75 ) with weight 1.9
q_{1} = ( 70, 24.6 ) with weight 0.6
The following is the resulting NURBS curve and its basis functions: