Charles Hagwood
Here is the whole example with a plot where the data points are black
and the equidistant points are red:
Needs["Splines`"];
d = RandomReal[1, {5, 2}]
sp = SplineFit[d, Cubic];
f1[t_?NumericQ] := sp[t][[1]];
f2[t_?NumericQ] := sp[t][[2]];
fun = Evaluate@{Evaluate@
FunctionInterpolation[f1[t], {t, 0, 4},
InterpolationOrder -> 4][#],
Evaluate@
FunctionInterpolation[f2[t], {t, 0, 4},
InterpolationOrder -> 4][#]} &;
ltan = FunctionInterpolation[Norm[fun'[tt]], {tt, 0, 4}]
s = FunctionInterpolation[
Integrate[ltan[ttt], {ttt, 0, tt}], {tt, 0, 4}]
param = par /.
NDSolve[{par'[x] == 1/ltan[par[x]], par[0] == 0},
par, {x, 0, s[4]}][[1]]
ParametricPlot[fun[param[t]], {t, 0, s[4]},
Epilog -> {Red,
Point[Table[sp[Min[4, Max[0, param[t]]]], {t, 0, s[4], s[4]/100}]],
Black, Point[d]}]
Daniel
On 31 Dez., 09:12, "Hagwood, Charles R." <charles.hagw...@nist.gov>
wrote:
> How does one uniformly sample a spline gotten from the
> command SplineFit?
Did you try Table?
Needs["Splines`"]
pnt = {{0, 0}, {1, 1}, {2, 4}, {3, 9}, {4, 16}};
spl = SplineFit[pnt, Cubic]
tbl = Table[spl[t], {t, 0, 4, .2}]
Show[{
ListPlot[pnt, Joined -> True],
ListPlot[tbl, PlotStyle -> Red]
}
]
Regards,
Dave.