B Spline Calculator
Calculate a point on a 2D B spline curve, inspect the generated knot vector, and visualize the control polygon, smooth spline curve, and evaluated parameter location in one premium interactive tool.
Curve visualization
The chart overlays the control polygon, the evaluated B spline curve, and the current point corresponding to the selected parameter value.
Expert guide to using a B spline calculator
A B spline calculator helps you evaluate and visualize one of the most useful curve representations in numerical computing, computer aided design, computer graphics, robotics, and data fitting. If you have ever worked with smooth paths that need controllable shape, numerical stability, and local editability, B splines are usually near the top of the list. This page is designed to do more than simply output a coordinate. It lets you define control points, choose a spline degree, select a knot style, set a parameter value, and immediately see both the computed point and the full geometry of the curve.
At a high level, a B spline curve is formed by blending control points with basis functions. Those basis functions depend on the degree and the knot vector. Instead of every point affecting the whole curve in the same way, B splines have compact support. That means each basis function is only active over a limited region of the parameter domain. In practice, this gives B splines a major advantage over many global interpolation methods: a local edit changes the nearby shape without unpredictably moving everything else.
What the calculator computes
This calculator evaluates a 2D B spline curve from a set of control points. It uses the standard Cox to de Boor recursion for basis functions and then computes the curve point with the classic formula:
C(t) = Σ N(i,p)(t) P(i)
Here, P(i) are the control points, p is the degree, and N(i,p)(t) are the B spline basis functions. The result is a point on the curve at parameter t. The chart also samples many points across the valid parameter interval so you can inspect the overall shape instead of only a single evaluation point.
Inputs explained
- Control points: Enter one coordinate pair per line using the format x,y.
- Degree: Degree 1 creates piecewise linear segments, degree 2 gives quadratics, and degree 3 produces cubic curves.
- Knot vector type: Uniform spreads knots evenly. Clamped uniform repeats the first and last knots so the curve starts and ends at the endpoints.
- Parameter t: This selects the location on the curve to evaluate.
- Sample points: More samples improve the visual smoothness of the plotted curve.
Important: You need at least degree + 1 control points to define a valid B spline. In real projects, using more control points gives more shape flexibility, while increasing degree mostly changes smoothness and the width of local influence.
Why B splines are widely used
B splines became foundational in geometric modeling because they solve several engineering problems at once. They are stable, flexible, and efficient. A designer can move one control point and only alter part of the curve. A numerical analyst can evaluate the curve using recursive basis functions. A software engineer can refine or sample the curve without rebuilding everything from scratch. This combination is why B splines appear in CAD systems, typography, finite element methods, path planning, image processing, and surface modeling.
Another reason they are so powerful is that they generalize nicely. Bezier curves are a special case. NURBS, which dominate industrial freeform CAD, are rational extensions built on top of B spline basis functions. Once you understand B splines, you have the conceptual foundation for a large family of shape representations used in technical software.
Key benefits
- Local control: Only a subset of control points affects a given parameter interval.
- Smoothness: For simple interior knots, a degree p B spline is typically C(p-1) continuous.
- Numerical robustness: Basis functions are nonnegative and usually sum to 1 over the active interval.
- Affine invariance: Translation, rotation, and scaling behave predictably.
- Scalability: Splines can represent long complex curves more efficiently than stitching many independent Bezier segments without continuity management.
B spline vs Bezier curves
Many users first encounter smooth curves through Bezier geometry, so it is useful to compare the two. Bezier curves are elegant and intuitive for small curve segments. However, every control point influences the entire segment. As complexity grows, this becomes harder to manage. B splines solve that by introducing knots and local support. If you need a long, editable curve with many control points, B splines are generally more practical.
| Property | Bezier Curve | B Spline Curve |
|---|---|---|
| Global vs local influence | All control points influence the entire segment | Only a limited number of control points influence each span |
| Typical continuity handling | Requires manual segment joining for multi segment curves | Continuity follows naturally from degree and knot multiplicity |
| Endpoint interpolation | Yes for a single Bezier segment | Yes for clamped B splines, not necessarily for uniform unclamped splines |
| Polynomial degree for many controls | Rises with control point count in one segment | Can keep a low fixed degree such as 3 while adding more control points |
| Industrial modeling use | Good for isolated patches and graphics work | Excellent for CAD, CAM, simulation geometry, and path design |
Real numeric data that matters in practice
When people ask for statistics related to B splines, they often want concrete numeric guidance rather than abstract theory. The table below summarizes exact mathematical properties that directly affect modeling performance and smoothness. These values are not estimates. They follow from standard spline theory and are used across computational geometry references.
| Degree p | Polynomial order | Continuity at simple interior knots | Control points affecting one span | Common use case |
|---|---|---|---|---|
| 1 | 2 | C0 | 2 | Polyline style piecewise linear paths |
| 2 | 3 | C1 | 3 | Basic smooth fitting and lightweight path smoothing |
| 3 | 4 | C2 | 4 | Most common CAD and animation choice |
| 4 | 5 | C3 | 5 | Higher smoothness for analysis and specialized design |
| 5 | 6 | C4 | 6 | Advanced approximation and research workflows |
There is also a precise relationship between knot multiplicity and continuity. At an interior knot with multiplicity m, the continuity becomes C(p-m). For example, a cubic spline with degree 3 and an interior knot repeated twice has continuity C1. If repeated three times, continuity drops to C0. This is one of the most useful numeric design rules in practical spline work because it lets you intentionally create corners, reduced smoothness, or local shape transitions.
How to interpret the graph
The plotted control polygon is the piecewise straight line connecting your control points. This polygon usually does not equal the spline itself, but it is a very important design scaffold. The smooth plotted curve is the B spline created by the selected degree and knot vector. The highlighted point marks the evaluated location at the current parameter value. If you move t from 0 to 1 in a clamped setup, that point will travel from the first endpoint to the last endpoint.
If you choose a uniform knot vector instead of a clamped one, the parameter domain still maps over the generated knots, but the resulting curve does not necessarily pass through the first and last control points. This behavior is mathematically normal and often surprises beginners. It is one reason many practical interfaces default to clamped knots for user facing design tools.
Common patterns you will notice
- Increasing the degree usually makes the curve smoother, assuming enough control points are available.
- Adding more control points gives more local shape resolution without forcing a higher degree.
- Clamped cubic curves often provide the most intuitive balance of endpoint behavior and smoothness.
- A low sample count can make a smooth curve look jagged on screen even when the math is correct.
Practical applications of a B spline calculator
A B spline calculator is useful in many technical and creative domains:
- CAD and CAM: Designers model product contours, body panels, tool paths, and surface sections.
- Robotics: Engineers define smooth trajectories with controllable curvature and local path refinement.
- Computer graphics: Artists and developers create editable motion paths and vector shapes.
- Data fitting: Analysts smooth noisy measurements while preserving useful structure.
- Simulation and analysis: Splines support geometry representation in numerical methods and approximation theory.
In all of these fields, the core advantage is the same: you get a mathematically structured curve that is easier to edit than a pure high degree polynomial fit. That matters because real workflows involve iteration. Shapes change. Constraints change. Requirements change. A tool like this calculator helps you experiment quickly and understand the geometry before implementing it in a production system.
How to choose the right degree
If you are uncertain about degree, start with cubic, degree 3. That is the default in many professional contexts because cubic splines are smooth enough for most design tasks while still being computationally straightforward. Degree 2 can be useful when you want a little less smoothness and slightly tighter local behavior. Degrees above 3 are valid but can be harder to manage visually and numerically unless you have a specific reason to need higher continuity.
Rule of thumb: For interactive shape design, cubic B splines are often the safest default. Increase the number of control points before increasing degree unless you specifically need more continuity.
Trusted educational references
If you want to go deeper into B spline theory, these authoritative references are excellent starting points:
- NIST Dictionary of Algorithms and Data Structures: B spline
- Michigan Technological University spline notes
- MIT Hyperbook on B spline curves
Frequently asked questions
Does a B spline always pass through every control point?
No. In general, a B spline approximates its control polygon rather than interpolating every control point. A clamped B spline usually passes through the first and last control points, but not necessarily the interior ones.
What is the difference between degree and order?
Order is degree plus one. So a cubic B spline has degree 3 and order 4.
Why does the result change when I switch knot types?
The knot vector determines where basis functions activate and overlap. Even with the same control points and degree, a different knot vector changes the blending and therefore changes the shape of the curve.
Why is my curve invalid?
The most common reason is not having enough control points for the selected degree. You need at least degree plus one control points. Formatting errors in the point list can also cause invalid input.
Final takeaway
A good B spline calculator is more than a convenience. It is a compact way to understand one of the most important curve models in computational geometry. By experimenting with control points, degree, knots, and parameter values, you can see how local support, continuity, and endpoint behavior work together. If you are building CAD tools, smoothing paths, fitting data, or simply learning spline math, mastering these controls will give you practical intuition that scales to advanced topics like knot insertion, NURBS, and spline surfaces.