# Constructing a 2D curve from a curvature function dynamically

I want to plot a curve starting from its curvature function and some initial conditions. This code generates a 2D curve with a given curvature (fun) and some initial conditions:

curveOfCurvatureK[
fun_, a_: 0, {c_: 0, d_: 0, e_: 0}, {smin_: - 10, smax_: 10}, optsnd___][t_] :=
Module[{x, y, θ, s},
eqs = {x'[s] == Cos[θ[s]],
y'[s] == Sin[θ[s]], θ'[s] == fun[s], x[a] == c,
y[a] == d, θ[a] == e};
sol = NDSolve[eqs, {x, y, θ}, {s, smin, smax}, optsnd];
{x[t], y[t]} /. sol[[1]]]


Then executing:

points = {{0, 2}, {1, 3}, {1/2, 1}, {3/2, 4}, {2, 2}, {5/2, 2}, {3,0}};
k := Interpolation[points];
GraphicsGrid[
{{Plot[k[x], {x, 0, 3}],
ParametricPlot[
Evaluate[curveOfCurvatureK[k, 0, {0, 0, 0}, {0, 3}]][x], {x, 0, 3}]}}]


I get the plot of the curvature next to the corresponding curve obtained. I want to know how to make the same thing but interactive. That is, generate a curvature function on the left that can be moved, like:

DynamicModule[{points = {{0., 2}, {0.5, 3}, {1., 1}, {1.5, 4}, {2., 2}, {2.5, 2}, {3., 2}}},
LocatorPane[
Dynamic[points],
Dynamic[
Plot[Interpolation[points, x], {x, 0, 3}, PlotRange -> {0, 5}]]]]


and then obtain (dynamically) the corresponding 2D curve on the right.

How can I do that? I have already searched related problems and could not find anything to make it work.

• – Michael E2 Sep 6 '19 at 22:25

DynamicModule[{points = {{0., 2}, {0.5, 3}, {1., 1}, {1.5, 4}, {2., 2}, {2.5, 2}, {3., 2}},
`