De Boor's algorithm
In the mathematical subfield of numerical analysis, de Boor's algorithm is a polynomial-time and numerically stable algorithm for evaluating spline curves in B-spline form.[src] It is a generalization of de Casteljau's algorithm for Bézier curves.[src] The algorithm was devised by German-American mathematician Carl R.[src] de Boor.[src] Simplified, potentially faster variants of the de Boor algorithm have been created but they suffer from comparatively lower stability.[src]
In the mathematical subfield of numerical analysis, de Boor's algorithm is a polynomial-time and numerically stable algorithm for evaluating spline curves in B-spline form.[src] It is a generalization of de Casteljau's algorithm for Bézier curves.[src] The algorithm was devised by German-American mathematician Carl R.[src] de Boor.[src] Simplified, potentially faster variants of the de Boor algorithm have been created but they suffer from comparatively lower stability.[src] \mathbf{S}(x) = \sum_i \mathbf{c}_i B_{i,p}(x).[src] B-splines of order p + 1 are connected piece-wise polynomial functions of degree p defined over a grid of knots {t_0, \dots, t_i, \dots, t_m} (we always use zero-based indices in the following).[src] De Boor's algorithm uses O(p 2 ) + O(p) operations to evaluate the spline curve.[src] Note: the main article about B-splines and the classic publications use a different notation: the B-spline is indexed as B_{i,n}(x) with n = p + 1 .[src] B_{i,0}(x) := \begin{cases} 1 & \text{if } \quad t_i \leq x B_{i,p}(x) := \frac{x - t_i}{t_{i+p} - t_i} B_{i,p-1}(x) + \frac{t_{i+p+1} - x}{t_{i+p+1} - t_{i+1}} B_{i+1,p-1}(x).[src] Let the index k define the knot interval that contains the position, x \in [t_{k},t_{k+1}) .[src] We can see in the recursion formula that only B-splines with i = k-p, \dots, k are non-zero for this knot interval.[src] Thus, the sum is reduced to: \mathbf{S}(x) = \sum_{i=k-p}^{k} \mathbf{c}_i B_{i,p}(x).[src] It follows from i \geq 0 that k \geq p .[src] Similarly, we see in the recursion that the highest queried knot location is at index k + 1 + p .[src] This means that any knot interval [t_k,t_{k+1}) which is actually used must have at least p additional knots before and after.[src] In a computer program, this is typically achieved by repeating the first and last used knot location p times.[src] For example, for p = 3 and real knot locations (0, 1, 2) , one would pad the knot vector to (0,0,0,0,1,2,2,2,2) .[src] Let \mathbf{d}_{i,r} be new control points with \mathbf{d}_{i,0} := \mathbf{c}_{i} for i = k-p, \dots, k .[src] For r = 1, \dots, p the following recursion is applied: \mathbf{d}_{i,r} = (1-\alpha_{i,r}) \mathbf{d}_{i-1,r-1} + \alpha_{i,r} \mathbf{d}_{i,r-1}; \quad i=k-p+r,\dots,k \alpha_{i,r} = \frac{x-t_i}{t_{i+1+p-r}-t_i}.[src] Once the iterations are complete, we have \mathbf{S}(x) = \mathbf{d}_{k,p} , meaning that \mathbf{d}_{k,p} is the desired result.[src] De Boor's algorithm is more efficient than an explicit calculation of B-splines B_{i,p}(x) with the Cox-de Boor recursion formula, because it does not compute terms which are guaranteed to be multiplied by zero.[src] The algorithm above is not optimized for the implementation in a computer.[src] It requires memory for (p + 1) + p + \dots + 1 = (p + 1)(p + 2)/2 temporary control points \mathbf{d}_{i,r} .[src] Each temporary control point is written exactly once and read twice.[src] By reversing the iteration over i (counting down instead of up), we can run the algorithm with memory for only p + 1 temporary control points, by letting \mathbf{d}_{i,r} reuse the memory for \mathbf{d}_{i,r-1} .[src] Similarly, there is only one value of \alpha used in each step, so we can reuse the memory as well.[src] Furthermore, it is more convenient to use a zero-based index j = 0, \dots, p for the temporary control points.[src] The relation to the previous index is i = j + k - p .[src] Thus we obtain the improved algorithm: Let \mathbf{d}_{j} := \mathbf{c}_{j+k - p} for j = 0, \dots, p .[src] Iterate for r = 1, \dots, p : \mathbf{d}_{j} := (1-\alpha_j) \mathbf{d}_{j-1} + \alpha_j \mathbf{d}_{j}; \quad j=p, \dots, r \quad \alpha_j := \frac{x-t_{j + k - p}}{t_{j+1+k-r}-t_{j+k-p}}.[src] Note that must be counted down.[src] After the iterations are complete, the result is \mathbf{S}(x) = \mathbf{d}_{p} .[src] def deBoor(k: int, x: int, t, c, p: int): """Evaluates S(x).[src] Arguments --------- k: Index of knot interval that contains x.[src] x: Position.[src] t: Array of knot positions, needs to be padded as described above.[src] c: Array of control points.[src] p: Degree of B-spline.[src] """ d = [c[j + k - p] for j in range(0, p + 1)] for r in range(1, p + 1): for j in range(p, r - 1, -1): alpha = (x - t[j + k - p]) / (t[j + 1 + k - r] - t[j + k - p]) d[j] = (1.0 - alpha) * d[j - 1] + alpha * d[j] return d[p][src]
45 sentences · 45 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"De Boor's algorithm." encyclopegia.org, 2025, https://encyclopegia.org/wiki/de-boor-s-algorithm. Accessed 28 November 2026.
Chicago
"De Boor's algorithm." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/de-boor-s-algorithm.
APA
encyclopegia.org. (2025). De Boor's algorithm. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/de-boor-s-algorithm
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON