Overview: What this B-spline basis calculator does
This calculator evaluates scalar B-spline basis functions Ni,k(t) for a user-defined knot vector, spline degree, and parameter value t. It returns the full set of basis values of degree k that are nonzero at your chosen parameter. These basis values are the weights that, when multiplied by control points, produce B-spline and NURBS curves.
The tool is designed for students, engineers, and developers who need to:
Verify a B-spline basis implementation in code (e.g., Cox–de Boor recursion).
Check numeric values while debugging graphics, CAD, or animation pipelines.
Experiment with how knots, degree, and parameter t affect local support and smoothness.
To use it, enter a non-decreasing knot vector (for example, an open uniform sequence), choose a spline degree (0 for piecewise constant, 1 for linear, 2 for quadratic, and so on), and specify a parameter value t. The calculator evaluates all relevant basis functions Ni,k(t) and outputs the values as a list or array.
Definition of B-spline basis functions
Let the knot vector be a non-decreasing sequence of real numbers
t0, t1, …, tm. For a fixed degree k ≥ 0, the B-spline basis functions Ni,k(t) are defined recursively. Each basis function is supported only on a finite interval of the parameter domain and is a piecewise polynomial of degree k.
Degree 0 (piecewise constant) basis
For k = 0, each basis function is a simple box function:
Ni,0(t) = 1 if ti ≤ t < ti+1, and 0 otherwise.
In MathML notation, a generic B-spline basis function of degree k can be represented as:
where each individual basis function Ni,k(t) is nonzero only over a small subset of the domain defined by the knots.
Cox–de Boor recursion for higher degrees
For k > 0, the basis functions are defined using the Cox–de Boor recursion. Intuitively, each degree-k basis is a weighted blend of two degree-(k−1) basis functions:
where the scalar weights are defined by the knot positions:
Ai,k(t) =
(t − ti) / (ti+k − ti) when the denominator is nonzero, and 0 otherwise.
Bi,k(t) =
(ti+k+1 − t) / (ti+k+1 − ti+1) when the denominator is nonzero, and 0 otherwise.
Because each basis is built from lower-degree functions, you get a family of smooth, locally supported polynomials. Increasing the degree raises smoothness (more continuous derivatives) as long as the knot multiplicities do not introduce discontinuities.
How to use the calculator step by step
Enter the knot vector.
Provide a non-decreasing list of real numbers, separated by commas, such as
0,0,0,1,2,3,3,3. The list defines both the domain and the local support of each basis function.
Choose the spline degree k.
Use a non-negative integer:
k = 0: piecewise constant basis.
k = 1: piecewise linear, C0 (continuous but with sharp corners at knots).
k = 2: quadratic, typically C1 where knots are simple.
k = 3: cubic, a common choice in CAD and animation for smooth curves.
Specify the parameter value t.
This is the point in the parameter domain where you want to evaluate the basis.
For open B-splines, t usually lies between the first and last interior knots.
Run the calculation.
Click the Evaluate button. The tool computes all nonzero B-spline basis functions Ni,k(t) associated with your knot vector and displays the numeric values.
Use the results.
If you have control points Pi, you can reconstruct the corresponding point on a B-spline curve at parameter t by computing
∑i Ni,k(t) Pi.
This is often done in separate code or a companion curve-point calculator.
Interpreting the basis values
The calculator outputs one value per basis function index i, all at the same parameter t and degree k. These values have several important properties:
Non-negativity: For standard B-spline bases, Ni,k(t) ≥ 0 for all i and t.
Partition of unity: On the interior of the knot vector, the basis functions satisfy
∑i Ni,k(t) = 1.
Local support: For any fixed i, Ni,k(t) is nonzero only when t is in the interval [ti, ti+k+1). If you move t outside that range, the corresponding basis value drops to 0.
Effect of repeated knots: Repeating a knot reduces smoothness at that location. Basis functions overlapping a repeated knot will show visible changes such as sharper corners or discontinuities in higher derivatives.
In practice, a few basis values around t will be nonzero; all others should be exactly zero or very close to zero (up to numerical rounding). Large deviations from these expectations often indicate an issue with the input knot vector or degree.
Worked example: quadratic B-spline basis
Consider a quadratic (k = 2) B-spline with the open uniform knot vector:
[0, 0, 0, 1, 2, 3, 3, 3].
To reproduce the sample values often seen in textbooks:
Enter the knot vector as 0,0,0,1,2,3,3,3.
Set the spline degree to 2.
Evaluate at t = 0.5, t = 1.5, and t = 2.5.
The expected basis values Ni,2(t) (rounded to two decimals) are shown below:
t
N0,2(t)
N1,2(t)
N2,2(t)
N3,2(t)
N4,2(t)
0.5
0.25
0.63
0.13
0.00
0.00
1.5
0.00
0.13
0.75
0.13
0.00
2.5
0.00
0.00
0.13
0.63
0.25
These numbers illustrate several key properties:
Only three basis functions are nonzero around each t value, illustrating local support.
The values at each t sum to 1 (within rounding), confirming the partition of unity property.
As t moves from 0.5 to 2.5, the influence shifts smoothly from lower-index bases (N0,2, N1,2) to higher-index bases (N3,2, N4,2).
Comparison: B-splines vs. related representations
B-spline basis functions generalize and extend other familiar curve representations. The table below contrasts them with a few alternatives.
Representation
Local control
Continuity
Typical use cases
B-spline basis (this calculator)
Yes, each basis has compact support over a few knot spans.
No local refinement; changing one control point affects the whole curve.
Globally smooth within a single segment; joins may reduce continuity.
Simple curve segments, graphics primitives, font outlines.
NURBS curves
Same local support as B-splines but with weights per control point.
Similar to B-splines; can exactly represent conic sections.
Industrial CAD, CAM, exact representation of circles and arcs.
Piecewise polynomials without B-spline basis
Depends on construction; may lack convenient local control.
Can be smooth but often harder to manage at joints.
Custom numerical schemes, ad-hoc interpolation.
The B-spline basis computed by this tool is the foundational building block behind many of these other models, especially NURBS.
Assumptions, limitations, and practical notes
For reliable and interpretable results, keep the following assumptions and limitations in mind when using the calculator:
Non-decreasing knot vector:
The knot sequence must be non-decreasing. If you enter knots that decrease (for example, 0, 1, 0.5, 2), the basis definition no longer applies in the usual sense, and numerical results may be meaningless.
Open B-spline convention:
Many practical curves use an open knot vector, where the first and last knots are repeated k+1 times. The calculator does not enforce this, but if you want interpolation at the endpoints, you should follow that pattern manually.
Valid index range and length:
For degree k and knot vector length m + 1, the number of nonzero basis functions is typically m − k − 1. Very short knot vectors relative to the chosen degree may not define any valid basis functions.
Parameter range:
The most meaningful evaluations are for t in [tk, tm−k]. If you choose t outside the span of the interior knots, you may see all zeros or only one basis function equal to 1, depending on the convention used at the boundaries.
Non-rational basis:
This tool evaluates standard, non-rational B-spline basis functions. It does not include weights or perform NURBS normalization. To work with NURBS, you must apply additional weights and normalization in a separate step.
Floating-point rounding:
Due to finite precision arithmetic, sums of basis values may differ slightly from 1 (for example, 0.999999 or 1.000001). Such small discrepancies are normal in numerical computations.
Continuity at repeated knots:
Repeating an interior knot r times reduces continuity at that knot to Ck−r. Extremely high multiplicities may produce sharp corners or even breaks in derivatives, which will be reflected in the shape of the basis functions but not directly visible in a single numeric evaluation.
No curve drawing in this tool:
The calculator focuses on basis values only. It does not plot the basis functions or resulting curves. For visualization, you can sample the basis at many t values and plot them with external software.
Keeping these points in mind will help you diagnose unexpected outputs, such as all-zero basis values, negative values, or results that do not appear to sum to one.
Related workflows
The numeric basis values from this calculator often serve as an intermediate step in broader workflows:
Implementing a custom B-spline curve or surface evaluator in C++, Python, or shader code.
Validating shape functions in isogeometric finite element methods.
Studying how knot insertion or degree elevation changes local support.
For these tasks, you might pair this tool with curve-point calculators, derivative evaluators, or NURBS utilities that consume the basis values and your control points.
Interactive cubic spline interpolation calculator for smooth curve fitting. Build a natural cubic spline through your data points, evaluate any x, and explor...
Interactive orthogonal projection calculator for vectors in R^3. Enter a vector and up to three (possibly non-orthonormal) basis vectors to compute its proje...