Skip to content

Commit 67743af

Browse files
Update clarification.md
1 parent 4846b71 commit 67743af

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/src/clarification.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
# 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.
34

45
# 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)
1214
```
15+
1316
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).
1417
Thus, the plot for B-Spline interpolation does not appear the same as the plot for Constant Interpolation.
1518

1619
# Derivative behavior of quadratic B-Spline
17-
```@example tutorial
20+
21+
```@example interpclarity
1822
bspline = BSplineInterpolation(u, t, 2, :Uniform, :Uniform; extrapolation_left=ExtrapolationType.Extension, extrapolation_right=ExtrapolationType.Extension)
1923
plot(t->derivative(bspline, t))
2024
```
25+
2126
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.
2227
Hence, sudden spikes near the ends and sharp negative excursions where basis support ends.

0 commit comments

Comments
 (0)