# Drawing an arrow and manipulating it in a diagram

I want to draw an arrow in a diagram which starts from a point, say, $(x,\,\sqrt{x^2+2})$ and ends up at a point, say, $(x',\,\sin{x^2})$.

I want to manipulate or animate such an arrow. For example, I want to animate how the arrow starting from a point proceeds to the end point. But I don't know how!

Any idea would be appreciated!

• Press F1, lookup Graphics, Arrow, Manipulate. – Kuba Oct 19 '17 at 21:29
• @Kuba Didn't help. – Immanuel Oct 19 '17 at 21:36
• At both stages! I cannot draw an arrow which I can manipulate or animate it. – Immanuel Oct 19 '17 at 21:39
• @Kuba I edited the OP. – Immanuel Oct 19 '17 at 21:45

But how can I animate the growing of the arrow starting from a point and ending up at another point?

Per comment. This version supports different x for each function.

Manipulate[

Plot[{g, f}, {x, -10, 10}, PlotLegends -> {"f(x)", "g(x)"},
PlotRange -> {{-5, 5}, {-5, 5}},
Epilog -> {Arrow[{{xfValue, f /. x -> xfValue}, {xgValue,
g /. x -> xgValue}}]}
],

Grid[{
{Control[{{f, Sqrt[x^2 + 2]}, InputField}]},
{Control[{{g, Sin[x^2]}, InputField}]}}
],

{{xfValue, 1, "x for f"}, -10, 10, .1, Appearance -> "Labeled"},
{{xgValue, 4.1, "x for g"}, -10, 10, .1, Appearance -> "Labeled"}
]

• Nice! But how can I animate the growing of the arrow starting from a point and ending up at another point? – Immanuel Oct 20 '17 at 10:47
• @Immanuel updated new version. Removed old versions as not needed any more. – Nasser Oct 20 '17 at 13:36