Natural Cubic Spline Calculator
Interpolate measured knots with a twice-continuous cubic spline and zero endpoint second derivatives.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Sort knots, solve the tridiagonal system for knot second derivatives and evaluate the containing cubic segment.
hᵢ₋₁ Mᵢ₋₁+2(hᵢ₋₁+hᵢ)Mᵢ+hᵢ Mᵢ₊₁=6(slopeᵢ−slopeᵢ₋₁); endpoints M=0
Worked example
Knots (0,0),(1,1),(2,0),(3,1) have natural second derivatives 0,−4,4,0 and spline value 0.5 at x=1.5.
Assumptions and input details
3–100 well-separated distinct X knots, no extrapolation. Natural endpoint curvature is an explicit boundary condition; spline may overshoot and is not monotonicity-preserving or a smoothing fit.
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Interpolate distinct X/Y knots with one global polynomial using the barycentric evaluation formula.
Enter two known points and a target x or y. Calculate the other coordinate, view the straight-line model and clearly distinguish interpolation from extrapolation.
Evaluate a cubic Bezier curve, its tangent and an approximate length from four control points.
Reserved advertising space.