This simulation lets you build and reshape Bézier, B-spline and NURBS curves by dragging control points. Bézier curves are evaluated live with the recursive de Casteljau algorithm, while B-splines and NURBS are evaluated with the Cox–de Boor basis functions over a clamped knot vector. NURBS add a per-point weight, which pulls the curve toward heavier points and — with the right weights and a non-uniform knot vector — can represent an exact circular arc, something ordinary Bézier and B-spline curves can never do.
For Bézier curves, the de Casteljau scaffold repeatedly linearly interpolates between control points at parameter t, visibly collapsing level by level to the point on the curve. For B-splines and NURBS, the curve is built from Cox–de Boor basis functions evaluated over a clamped knot vector, and the knot vector itself can be displayed. Toggling colour-by-t recolours the curve along its parameter range, and the "Exact circle" preset shows a 9-point rational NURBS with alternating weights of 1 and √2⁄2 tracing a mathematically perfect circle.
Pick a curve type (Bézier, B-spline or NURBS), then drag the hollow square control points to reshape the curve, or click empty space to add a new point. The Degree slider (1–5) sets the spline degree, Parameter t (0–1) moves the highlighted point along the curve or drives the de Casteljau scaffold, and the Weight slider (0.1–8) reshapes NURBS curves around whichever point is selected. Auto-sweep animates t automatically, and presets load an S-curve, a looping B-spline, an exact NURBS circle or a NURBS quarter-arc.
A NURBS circle isn't an approximation — with exactly the right control points, weights of 1 and √2⁄2 at alternating corners of a square-ish polygon, and a knot vector with repeated interior knots (multiplicity 2), the rational basis functions reproduce a perfect circular arc. This is why NURBS, not plain Bézier or B-spline curves, is the standard for representing circles, ellipses and other conic sections in CAD software.
A Bézier curve is a smooth curve defined by a set of control points, where the curve itself typically only touches the first and last point while being "pulled" toward the others. De Casteljau's algorithm evaluates a point on the curve at parameter t by repeatedly taking linear interpolations: first between each pair of adjacent control points, then between those results, and so on until a single point remains. This recursive geometric process is numerically stable and is exactly what the coloured scaffold lines in the simulation visualise.
A B-spline is built from multiple polynomial pieces joined together smoothly, controlled by a knot vector that defines where each piece starts and ends, unlike a single Bézier curve which is one polynomial over its whole range. This means a B-spline can have many control points without the curve's degree growing arbitrarily large, and moving one control point only affects a local part of the curve rather than the entire shape. The degree slider in this simulation controls how many neighbouring control points influence each piece of the curve.
NURBS stands for Non-Uniform Rational B-Spline: "rational" because each control point has a weight that scales its influence, and "non-uniform" because the knot vector's spacing doesn't have to be even. Raising a control point's weight pulls the curve more strongly toward that point, as if it had more "gravity", while a weight of 1 for every point makes a NURBS curve behave exactly like an ordinary B-spline. This extra flexibility is what allows NURBS to represent shapes, like true circles and ellipses, that polynomial-only curves cannot.
A circle is a conic section, and representing it exactly requires rational (weighted) basis functions rather than plain polynomials, which is exactly what NURBS provides. The "Exact circle" preset in this simulation uses nine control points arranged in a square-like polygon with alternating weights of 1 and √2⁄2 (cos 45°), combined with a knot vector that repeats certain knots to create sharp joins between four quarter-circle arcs. The result traces a mathematically perfect circle, not just a close polygonal approximation.
A knot vector is a non-decreasing sequence of parameter values that determines where each polynomial segment of a B-spline or NURBS curve begins and ends, and how smoothly segments join at each knot. A "clamped" knot vector, used by default in this simulation, repeats the first and last knot enough times that the curve actually starts and ends at its first and last control points, just like a Bézier curve does. Repeating an interior knot (as the exact-circle preset does) reduces the curve's smoothness at that point, which is precisely how sharp transitions between circular arcs are created.