|
| 1 | +# Clarifications |
| 2 | +We will clarify regarding the issues raised through this doc |
| 3 | + |
| 4 | +# 0-order B-Spline Interpolations are not the same as Constant Interpolations |
| 5 | +```@example tutorial |
| 6 | +julia> using DataInterpolations, Plots |
| 7 | +julia> using DataInterpolations: derivative |
| 8 | +julia> u = [2.0, 1.0, 5.0, 4.0, 5.0, 4.0] |
| 9 | +julia> t = [0.0, 2.0, 3.5, 4.0, 5.0, 6.5] |
| 10 | +julia> bspline = BSplineInterpolation(u, t, 0, :Uniform, :Uniform; extrapolation_left=ExtrapolationType.Extension, extrapolation_right=ExtrapolationType.Extension) |
| 11 | +julia> plot(bspline) |
| 12 | +``` |
| 13 | + A B-spline curve is constructed using control coefficients, hence, the jump locations are at knot vectors and do not coincide with data points(which is the case for constant-interpolation). |
| 14 | +Thus, the plot for B-Spline interpolation does not appear the same as the plot for Constant Interpolation. |
| 15 | + |
| 16 | +# Derivative behavior of quadratic B-Spline |
| 17 | +```@example tutorial |
| 18 | +bspline = BSplineInterpolation(u, t, 2, :Uniform, :Uniform; extrapolation_left=ExtrapolationType.Extension, extrapolation_right=ExtrapolationType.Extension) |
| 19 | +plot(t->derivative(bspline, t)) |
| 20 | +``` |
| 21 | +The derivative becomes piecewise linear with jumps, and extrapolation can introduce sharp artifacts near boundaries, additionally derivative(bspline, t) is calculated by differentiating the spline basis and evaluating outside nominal knot spans using extension, not clamping. |
| 22 | +Hence, sudden spikes near the ends and sharp negative excursions where basis support ends. |
0 commit comments