Simple interpolation?

@dpsanders, in that situation Paul Dierckx is our friend:

using Dierckx, Plots
t = 0.05:.2:0.95; rt = rand(length(t));
x, y = 2sin.(π*t) .+ 0.3rt, cos.(π*t) .+ 0.2rt
spl = ParametricSpline(t, [x y]', bc="extrapolate", s = 0.1)
tfine = 0:.01:1
xys = evaluate(spl,tfine);
xy0 = evaluate(spl, 0.5)  # interpolate point at t=0.5
plot(xys[1,:], xys[2,:], aspect_ratio=1, label="Dierckx.jl parametric spline", title="Dierckx parametric spline")
scatter!(x, y, label="input points", xlimits = (-1.5,2.5))
scatter!([xy0[1]], [xy0[2]], ms=5, mc=:red, label="Interpolated", legend=:bottomleft) 

Dierckx_parametric_spline

5 Likes