What's the easiest way to get the following animation for a given parabola where the arc length is preserved (that is, for two points in the parabola, I straighten it as follows)
My main goal is the following, given a set of random points and a set of points following a parabola, I want to "straighten" the parabola and all the surrounding points according to the straightening of that parabola. Consider the following schematic
For instance, we could consider the points as a starter
f[x_, a_, b_] := a x^2 + b;
pts1 = RandomReal[{-1, 1}, {150, 2}];
ptsf = RandomReal[{-1, 1}, 50];
pts2 = Map[{#, f[#, .5, -.5]} &, ptsf];
Graphics[{Gray, Point /@ pts1, Red, Point /@ pts2}]
Where the red dots follow a parabola. How do change pts1
based on a
and b
? From such a pattern, I'd expect, after the transformation, to get something like
where the dots are sparser above the line and denser below it. I tried to make it work by using preservation of the arc length somehow, but it's too slow. For more details on the math, here's a more general question.
Edit: I'm pretty satisfied with the answers provided and they do answer part of the question. As for the plane transformation, this seems to be trickier. Consider the following (very messy) image.
What I want, as suggested by @I.M., is to transform the plane such that we get two focusing and defocusing regions. The tricky part is how to "straighten" the surrounding points. If we track three line segments with end points $\{1,2,3,4,5,6\}$, the line segment will change size as the curve changes, and I suspect the new points will follow new parabolas (see thiner coloured lines). Not sure if I can prove this. Ultimately, what I'm asking is how to implement the following plane transformation, where the x-axis becomes a parabola
What do you think?