B Spline Calculation Tool

Model B spline curves with flexible knot controls. Inspect basis functions and sampled coordinates quickly. Download outputs and compare curve behavior with practical examples.

Calculator Input

Common values are 2 or 3.
Values outside the domain are clamped.
Use only when custom type is selected.
For degree p and n+1 points, knot count must equal n+p+2.
Enter one point per line. Example: 0,0

Example Data Table

Example Degree Knot Type Control Points Expected Use
Smooth design curve 3 Clamped open uniform 0,0 | 1,2 | 3,3 | 4,1 | 5,2 | 6,0 General curve modeling
Simple quadratic path 2 Clamped open uniform 0,0 | 2,4 | 4,0 | 6,3 Fast path testing
Uniform basis check 3 Uniform 0,1 | 1,3 | 2,2 | 4,4 | 5,1 Basis behavior study

Formula Used

B spline curve:

C(u) = Σ Ni,p(u) Pi

Here, Pi are control points. Ni,p(u) are basis functions of degree p.

Cox-de Boor recursion:

Ni,0(u) = 1 when ti ≤ u < ti+1, otherwise 0.

Ni,p(u) = ((u-ti)/(ti+p-ti)) Ni,p-1(u) + ((ti+p+1-u)/(ti+p+1-ti+1)) Ni+1,p-1(u)

First derivative:

C'(u) = Σ p / (ti+p+1 - ti+1) × (Pi+1 - Pi) × Ni+1,p-1(u)

The tool also estimates arc length by summing distances between sampled curve points.

How to Use This Calculator

  1. Enter the spline degree. Cubic curves usually use degree 3.
  2. Add control points as x,y pairs. Put each point on a new line.
  3. Choose a knot vector type. Use clamped mode for endpoint interpolation.
  4. Enter a parameter value u for point evaluation.
  5. Set the sample count for the graph and data table.
  6. Press the calculate button. Results appear above the form.
  7. Review the plot, basis values, derivative, and arc length.
  8. Use CSV or PDF buttons to export your results.

Understanding B Spline Calculations

What This Tool Does

A B spline is a flexible curve made from control points. It does not always pass through every control point. Instead, the points guide the shape. This makes the curve stable and smooth. Designers use it in graphics, animation, machining, statistics, and modeling. The calculator evaluates the curve at a chosen parameter value. It also samples many points for plotting and export.

Why Degree Matters

The degree controls the local smoothness. A linear spline has straight segments. A quadratic spline gives smoother bends. A cubic spline is common because it balances control and smoothness. Higher degrees can look smoother, but they may be harder to control. The degree must be less than the number of control points.

How Knots Affect Shape

A knot vector controls how the parameter moves along the curve. Clamped knots force the curve to start and end at the first and last control points. Uniform knots spread parameter influence evenly. Custom knots allow advanced control. Repeated knots can reduce smoothness. They can also pull the curve toward a certain region.

Reading the Results

The evaluated x and y values show the curve position at u. Basis values show how much each control point contributes. The derivative describes direction and speed. A larger speed means the curve changes faster near that parameter. The arc length is approximate. More samples usually improve the estimate. The bounding box gives the minimum and maximum sampled coordinates.

Practical Uses

Use this tool to test curve paths before coding them elsewhere. Try different degrees and knot styles. Watch how the graph changes. Compare the control polygon with the final curve. Export the table for reports or further analysis. For technical work, increase the sample count. For quick previews, use fewer samples. Always check custom knots carefully before relying on results.

FAQs

1. What is a B spline?

A B spline is a smooth mathematical curve controlled by points, degree, and knots. It is widely used in graphics, design, modeling, and numerical applications.

2. Does the curve pass through every control point?

No. A B spline usually follows the control points without passing through all of them. Clamped curves normally pass through the first and last points.

3. What degree should I use?

Degree 3 is a common choice for smooth curves. Degree 2 is useful for simpler shapes. Degree 1 creates straight line segments.

4. What is a knot vector?

A knot vector controls how the parameter u affects the curve. It changes basis influence, smoothness, and endpoint behavior.

5. What is the valid u range?

The valid range is from knot value at index degree to knot value at index n plus one. The tool shows this domain after calculation.

6. Why use more samples?

More samples create a smoother plot and a better arc length estimate. They also produce a larger exported data table.

7. What does the derivative mean?

The derivative shows the curve direction and rate of change at the selected parameter. It helps analyze motion, slope, and local behavior.

8. Can I use custom knots?

Yes. Select custom knots and enter the required number of values. The needed count is number of points plus degree plus one.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.