|
1 | 1 | # Clarifications |
2 | | -We will clarify regarding the issues raised through this doc |
| 2 | + |
| 3 | +Here are some numerical clarifications of the algorithm definitions and behaviors. |
3 | 4 |
|
4 | 5 | # 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) |
| 6 | + |
| 7 | +```@example interpclarity |
| 8 | +using DataInterpolations, Plots |
| 9 | +using DataInterpolations: derivative |
| 10 | +u = [2.0, 1.0, 5.0, 4.0, 5.0, 4.0] |
| 11 | +t = [0.0, 2.0, 3.5, 4.0, 5.0, 6.5] |
| 12 | +bspline = BSplineInterpolation(u, t, 0, :Uniform, :Uniform; extrapolation_left=ExtrapolationType.Extension, extrapolation_right=ExtrapolationType.Extension) |
| 13 | +plot(bspline) |
12 | 14 | ``` |
| 15 | + |
13 | 16 | 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 | 17 | Thus, the plot for B-Spline interpolation does not appear the same as the plot for Constant Interpolation. |
15 | 18 |
|
16 | 19 | # Derivative behavior of quadratic B-Spline |
17 | | -```@example tutorial |
| 20 | + |
| 21 | +```@example interpclarity |
18 | 22 | bspline = BSplineInterpolation(u, t, 2, :Uniform, :Uniform; extrapolation_left=ExtrapolationType.Extension, extrapolation_right=ExtrapolationType.Extension) |
19 | 23 | plot(t->derivative(bspline, t)) |
20 | 24 | ``` |
| 25 | + |
21 | 26 | 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 | 27 | Hence, sudden spikes near the ends and sharp negative excursions where basis support ends. |
0 commit comments