Mercurial > repos > public > sbplib
comparison +parametrization/dataSpline.m @ 1197:433c89bf19e0 feature/rv
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 07 Aug 2019 15:23:42 +0200 |
parents | 36d092a00040 |
children | 60c875c18de3 |
comparison
equal
deleted
inserted
replaced
1196:f6c571d8f22f | 1197:433c89bf19e0 |
---|---|
1 % dataSpline calculates a Curve through the points f_i using cubic spline interpolation. | |
2 % The spline curve is parametrized with the arc length parametrization | |
3 % to facilitate better grids. | |
4 % | |
5 % f - m x D matrix of m points in D dimensions | |
6 function C = dataSpline(f) | |
7 m = size(f, 1); | |
8 | |
9 t = linspace(0,1,m); | |
10 | |
11 pp_g = spapi(4, t, f'); | |
12 pp_gp = fnder(pp_g); | |
13 | |
14 g = @(t) fnval(pp_g, t); | |
15 gp = @(t) fnval(pp_gp, t); | |
16 | |
17 C = parametrization.Curve(g, gp); | |
18 C = C.arcLengthParametrization(); | |
19 end |