I am trying to create this animation using Matplotlib animation features in Python. Unfortunately, I am not able to figure out what would be the driving logic for keeping the main curve intact and deleting the vertical and tangential lines.
I have made a very rudimentary try here and failing spectacularly since I am pretty new to the animation features of matplotlib (or for that matter any other package).
How can I build this animation?