comparison +parametrization/dataSpline.m @ 1125:0eef5c8ccb88 feature/poroelastic

Copy dataSpline() from feature/laplace_curvilinear_test
author Martin Almquist <malmquist@stanford.edu>
date Sat, 11 May 2019 19:19:09 -0700
parents
children 60c875c18de3
comparison
equal deleted inserted replaced
1124:c2d281633e14 1125:0eef5c8ccb88
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