JJ Ben-Joseph headshot JJ Ben-Joseph

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:

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:

N : \ R R

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:

Ni,k(t) = Ai,k(t) Ni,k-1(t) + Bi,k(t) Ni+1,k-1(t),

where the scalar weights are defined by the knot positions:

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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:

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:

  1. Enter the knot vector as 0,0,0,1,2,3,3,3.
  2. Set the spline degree to 2.
  3. 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:

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. Up to Ck−1 for degree k with simple knots. CAD, animation paths, isogeometric analysis, flexible curve modeling.
Bézier curves 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:

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:

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.

Enter knots and parameters.

Embed this calculator

Copy and paste the HTML below to add the B-Spline Basis Calculator to your website.