B-Spline Basis Calculator

Introduction

B-spline curves are built from basis functions, and those basis functions are what this calculator evaluates. When you supply a knot vector, a spline degree, and a parameter value t, the tool returns the basis values Ni,k(t) for every valid index i. In plain language, the result tells you how much influence each control point would have at that specific parameter location. If you already know B-splines from CAD, animation, numerical analysis, or NURBS work, you can think of this page as a quick way to inspect the exact weights behind the curve point calculation.

That makes the calculator useful in several different settings. Students can test their understanding of local support and partition of unity. Developers can compare their own Cox-de Boor implementation against a known output. Engineers can use it while debugging a modeling pipeline, especially when a curve point looks wrong and the first question is whether the basis values themselves are correct. Even if you are not drawing the curve on this page, seeing the numeric basis weights is often enough to diagnose an indexing mistake, a degree mismatch, or a bad knot vector.

A B-spline basis has a few special properties worth keeping in mind while you use the calculator. Each basis function is nonnegative, each one is only active across a limited interval of the knot vector, and the interior basis values typically add up to 1. Those features are the reason B-splines are so stable and practical: they give smooth curves, local control, and predictable blending. The calculator below helps you inspect those properties directly instead of treating them as abstract theory.

How to use

Start with the knot vector. Enter the knot values as a non-decreasing list separated by commas or spaces, such as 0,0,0,1,2,3,3,3. The knot vector sets the parameter intervals, determines where each basis function can be nonzero, and controls how smooth the final spline can be at each knot. Repeated knots are allowed, but they narrow support and reduce continuity at that location.

Next, choose the spline degree k. Degree 0 gives piecewise constant basis functions. Degree 1 gives piecewise linear basis functions. Degree 2 and degree 3 are the quadratic and cubic cases that appear often in textbooks, curve design, CAD kernels, and graphics systems. Finally, enter the parameter value t where you want the basis evaluated. If t falls outside the meaningful spline domain, the calculator warns you instead of returning a misleading set of values.

Input guide for the calculator
Input What it means Typical example
Knot vector A non-decreasing sequence that defines the parameter partition and local support of each basis function. 0,0,0,1,2,3,3,3
Degree The polynomial degree of the basis. Higher degree usually means smoother blending if knots are simple. 2 for quadratic or 3 for cubic
Parameter t The point in the parameter domain where the basis functions are evaluated. 1.5

After you click Evaluate, the result area lists all basis values for the chosen degree. In most interior evaluations, only a small cluster of neighboring functions will be nonzero. That is expected and is one of the defining ideas of B-splines: moving one control point only changes the curve where the associated basis function has support. The copy button lets you move those values into code, notes, or a test case without retyping them by hand.

Formula

The calculator uses the standard Cox-de Boor recursion. At degree 0, the basis functions are simple interval indicators. At higher degrees, each basis function is built from two lower-degree basis functions, scaled by knot-dependent weights. This recursive definition is what makes B-splines so flexible: a higher-degree smooth basis can be assembled from lower-degree pieces while still preserving compact support.

For degree 0, the idea is simple. The basis function Ni,0(t) equals 1 on its knot span and 0 elsewhere. For higher degrees, the recursion blends neighboring lower-degree functions according to how far t sits between the relevant knots. When a denominator becomes zero because of repeated knots, the corresponding term is treated as zero. That convention is standard and prevents undefined divisions from producing invalid numeric output.

Ni,0 (t) = { 1 if tit<ti+1 0 otherwise Ni,k (t) = t-ti ti+k-ti Ni,k-1 (t) + ti+k+1-t ti+k+1-ti+1 Ni+1,k-1 (t)

In MathML notation, a generic B-spline basis function of degree k can be represented as:

N : \ R โ†’ R

That preserved notation simply emphasizes that each basis function is a real-valued function of the parameter. In practice, the most important geometric fact is local support: Ni,k(t) is only nonzero on a limited interval, usually written as [ti, ti+k+1). So when you inspect the result array, most entries will be zero and only a few neighboring ones will matter at a given t.

If you later combine these basis values with control points Pi, you obtain the actual point on the spline curve at parameter t. The calculator does not perform that geometric step itself, but it gives you the exact scalar weights that feed into it. This is often the right level for debugging because an incorrect curve point almost always traces back to either a wrong control point set or a wrong basis evaluation.

Example

Consider the open uniform quadratic knot vector [0, 0, 0, 1, 2, 3, 3, 3] with degree 2. This is a classic test case because it is simple enough to reason about by hand while still showing the important behavior of a higher-degree B-spline basis. If you evaluate the basis at t = 1.5, the only active quadratic basis functions are the ones whose support covers the interval around that parameter value. The rest should be zero.

To reproduce the example with the calculator, enter the knot vector as 0,0,0,1,2,3,3,3, set the degree to 2, and try t values of 0.5, 1.5, and 2.5. Those three locations are helpful because they show the blend shifting from the left side of the spline to the center and then to the right side. Notice that the basis values move smoothly rather than jumping, which is exactly what you want from a quadratic blending system.

Quadratic B-spline basis values for an open uniform example
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

This worked example highlights three practical checks. First, only a few basis functions are nonzero at any one parameter, confirming local support. Second, the rows sum to 1 up to rounding, confirming partition of unity. Third, as t moves from 0.5 to 2.5, the dominant weight slides from lower-index basis functions toward higher-index ones. When you later multiply basis values by control points, that shifting weight is exactly what produces a smooth motion along the curve.

Reading and interpreting the result

The result array is easiest to interpret as a list of blending weights. If you see values such as [0.000000, 0.125000, 0.750000, 0.125000, 0.000000], that means the middle basis function is doing most of the work at that parameter while its two neighbors make smaller contributions. Because B-splines are nonnegative, a negative value is usually a sign that something has gone wrong in the input or in a custom implementation being tested against this page.

  • Non-negativity: standard B-spline basis values should not be negative.
  • Partition of unity: interior values usually add up to 1, which is why affine combinations of control points behave predictably.
  • Local support: many entries will be exactly zero because only nearby basis functions overlap a chosen parameter value.
  • Repeated knots: duplicates reduce smoothness and can make the nonzero region narrower or the transition sharper.

If the calculator reports that the basis sum is far from 1, treat that as a useful warning rather than a failure of the tool. It often means the degree is inconsistent with the knot vector, the parameter lies outside the active domain, or the knot sequence is not suitable for the basis you expected. Small deviations, on the other hand, are normal when values are rounded for display.

Limitations and assumptions

This calculator is intentionally focused on one task: evaluating scalar, non-rational B-spline basis functions. That narrow scope is helpful because it keeps the math transparent, but it also means there are a few assumptions you should be aware of. The knot vector must be non-decreasing, the degree must be a whole number zero or greater, and the knot vector must be long enough relative to the degree to define at least one basis function.

The page also assumes the usual convention that zero-denominator terms in the Cox-de Boor recursion contribute zero. That is the standard way to handle repeated knots, but it does not turn this into a NURBS calculator. If you want rational basis functions, conic sections, or an actual NURBS curve point, you still need extra control-point weights and a normalization step outside this tool.

  • Non-decreasing knots only: a decreasing knot vector does not define a standard B-spline basis.
  • Open knots are common but not required: the calculator allows any non-decreasing knot vector, not only open uniform ones.
  • Parameter range matters: values of t outside the active domain often produce all zeros or boundary behavior that is not useful for design work.
  • No plotting: this page computes numbers, not basis graphs or full spline geometry.
  • Floating-point rounding: displayed decimals are rounded, so exact symbolic identities may appear with tiny numeric differences.

Those limitations are usually acceptable because basis inspection is often a mid-step in a larger workflow. You might use the output here to validate a curve evaluator in code, to confirm finite-element shape functions in an isogeometric setting, or to study how changing degree and knot multiplicity affects locality. In each of those cases, what you need first is confidence that the raw basis values are correct.

Use a non-decreasing knot vector. The sample inputs above reproduce a standard quadratic textbook example.

Enter knots and parameters.

Mini-game: Basis Peak Dash

This optional mini-game turns the calculator idea into a fast timing challenge. Instead of typing a parameter and reading the basis weights, you watch a glowing parameter line sweep across live B-spline basis curves. Your job is to strike when the line crosses the peak of the highlighted basis function. The mechanic is simple on purpose: it trains your eye to notice where a basis function is strongest, how local support limits where it can matter, and how repeated knots can make a target narrower.

The game does not change the calculator result above. It is simply a visual, replayable way to build intuition. If you can consistently hit the right peak, you are learning exactly what the numeric output is telling you: at each parameter value, one small neighborhood of basis functions dominates the blend and the dominant one shifts smoothly as t moves through the knot vector.

Score0
Time75
Streak0
Wave1
Energy3
Best0

Optional arcade mini-game

Basis Peak Dash

Tap, click, or press Space when the moving parameter line crosses the glowing peak of the target basis function. Build streaks, survive repeated-knot twists, and finish with the highest score you can.

  • Goal: hit the highlighted peak as accurately as possible.
  • Controls: pointer or tap first, with Space or Enter as keyboard backup.
  • Twists: the sweep speeds up, repeated knots narrow the target, and late waves demand sharper timing.

Target: N1,2(t) near its peak.

Degree 2 ยท Knots 0,0,0,1,2,3,3,3

Best score is saved on this device. The mini-game is separate from the calculator and exists only to make basis behavior easier to see and remember.

Embed this calculator

Copy and paste the HTML below to add the B-Spline Basis Calculator | Evaluate Cox-de Boor Basis Functions to your website.